Web Hosting Talk







View Full Version : MySQL Problems


t c
10-26-2004, 05:11 PM
Hi, I will cut to the chase, I tried to install a hack on a vB forum and well my naive self didn't save a copy of the 21mb database beforehand. I now have problems and I cannot figure out what to do. I am not a MySQL coder so I have no clue how to undo anything.

The hack told me to run the following 3 queries:
ALTER TABLE `forum` ADD `security` TINYINT(1) UNSIGNED DEFAULT "1" NOT NULL;
ALTER TABLE `forum` ADD `forumpass` text NOT NULL;
ALTER TABLE `forum` ADD `passtimeout` int(8) UNSIGNED DEFAULT "0" NOT NULL;

I have the following error:
Invalid SQL: SELECT security,forumpass,passtimeout
FROM forum
WHERE forumid='3'
mysql error: Unknown column 'security' in 'field list'

mysql error number: 1054

Any and all help would be greatly appreciated. :confused:

pflangan
10-27-2004, 07:43 AM
sounds like the security field wasn't added.
try this first, and post your response from mysql

show create table forum

kuprishuz
10-27-2004, 12:15 PM
you may have misspelled the field name or something of the like when running the alter table queries

Mike Bell
10-27-2004, 12:23 PM
I don't know MySQL that well.. but figured I'd ask if "Security" is a keyword in it by any chance? Longshot but oh well ;-)

t c
10-27-2004, 04:46 PM
Originally posted by pflangan
sounds like the security field wasn't added.
try this first, and post your response from mysql

show create table forum

What do you mean by "show create table forum?

As for the others.. I have spelled everything right, etc. and thise were my results.

pflangan
10-27-2004, 05:47 PM
i mean;
on the command line

mysql>

execute the query
SHOW CREATE TABLE forum

it will return the sql script needed to recreate the forum table.
by looking at this, we can try and figure out what went wrong.

I know you say you executed the 3 queries above, but something happened, otherwise...

t c
10-28-2004, 04:29 AM
I just did that and well it didn't bring up anything for me.

pflangan
10-28-2004, 05:22 AM
c:\ or #:> mysql -u yourusername -p
mysql>yourpassword
mysql> USE yourdatabasename;
mysql> SHOW CREATE TABLE forum;

you could also use
mysql> DESCRIBE forum;

which will give you a description of all the fields in your table.

I'm assuming you have direct access to the mysql server, and are not trying to connect to it via php?

as a recommendation, from one who does, download and use sqlyog. www.webyog.com buy it!