0

After online searching I am still stuck with a confusing issue. No matter what SQL command I run on a specific table (keys) within MySQL command line I receive ERROR 1064 (42000).

mysql> SHOW TABLES;
+-----------------+
| Tables_in_site2 |
+-----------------+
| keys            |
| permissions     |
| profile         |
| user            |
+-----------------+
4 rows in set (0.00 sec)

Basic SELECT Search:

mysql> SELECT * FROM keys LIMIT 5;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'keys LIMIT 5' at line 1

This command works fine for the other tables in the DB, such as SELECT * FROM user LIMIT 5; Another example is

SHOW COLUMNS IN keys;

Works fine for the others, just not in keys.

Could someone have 'locked down' the table? Is it corrupted? If so how would I be able to copy/delete the table if no MySQL commands work on it?

FYI - MySQl Server version is 5.0.51a-3ubuntu5.8-log

1 Answer 1

3

keys is a reserved word.

See http://dev.mysql.com/doc/refman/5.6/en/reserved-words.html for a complete list.

Try using backticks:

 SHOW COLUMNS IN `keys`;
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.