mysqlphpmyadmin

Constant #1064 error on everything I do in mySQL through phpMyAdmin


1064 - You have an error in your SQL syntax

I've just done a fresh install of XAMPP and configured the usernames and passwords for phpMyAdmin and mySQL. So far so good, no errors and all working fine. But when I go to create a new database, create a new table, or even drop a table it always comes up with the #1064 Error message.

Error when dropping a database:

SELECT MAX( version ) FROM.WHERE db_name = 'new_database_test' AND table_name = '' AND FIND_IN_SET( 'DROP DATABASE', tracking ) >0

MySQL said:

#1064 - 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 'WHERE db_name = 'new_database_test' AND table_name = '' AND FIND_IN_SET('D' at line 1

Error when creating a database:

SQL query: Edit

SELECT MAX( version ) FROM.WHERE db_name = 'new_test_db' AND table_name = '' AND FIND_IN_SET( 'CREATE DATABASE', tracking ) >0

MySQL said:

#1064 - 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 'WHERE db_name = 'new_test_db' AND table_name = '' AND FIND_IN_SET('CREATE ' at line 1

Error when adding a table:

SQL query: Edit

SELECT MAX( version ) FROM.WHERE db_name = 'new_test_db' AND table_name = 'awesome_table' AND FIND_IN_SET( 'CREATE TABLE', tracking ) >0

MySQL said:

#1064 - 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 'WHERE db_name = 'new_test_db' AND table_name = 'awesome_table' AND FIND_IN' at line 1

Despite the errors it's showing the databases are getting created and dropped. But when I try to create a table it simply creates an empty table instead of including any of the columns I wanted.

Anybody have any idea how to fix this? I'm completely new to both mySQL and phpMyAdmin, so don't really know where to begin.

Thanks.


Solution

  • I have seen this problem on a couple of my students' machines, this year, while trying to teach them some basic SQL using XAMPP with PHPMyAdmin as an introductory user interface.

    It seemed from the error message that PMA was appending nonsense SQL onto the end of the SQL statements when trying to open certain tables, even when clicking on their name in the sidebar.

    Dropping the database and re-creating it didn't help, and unfortunately no obvious answers were forthcoming on my Google search.

    After determining that the problem was PMA related, and likely related to user-specific configurations, I did a little digging around in the phpmyadmin database.

    I found the nonsense SQL that was being appended to the queries in a row in the phpmyadmin.pma_table_uiprefs which associated the problem with my student's username, and the specific database and table name that was causing her the trouble. Jackpot! I deleted this row.

    After deleting that row, though, I tried shutting down and restarting Apache, MySQL, even my web browser, and the problem persisted. It wasn't until a total reboot of her machine that the problem vanished. (This was a Windows machine, FWIW, YMMV.)

    Hope this helps.

    Simón Ruiz

    Canterbury

    Technology