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.
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
Go to the table phpmyadmin->pma_table_uiperfs delete the rows that contains your table name. delete cookies, restart mysql engine.
What fixed it for me was:
1. go to table operations (where u clone or rename a table)
2. click on repair table (right side in table maintenance section)
EDIT:
actually what the problem is for me is lowercase table name and I used a uppercase select query ..
To everyone giving answers that have nothing to do with the question - there is an error in PHPMyAdmin itself - somehow it is storing some bad SQL and appending it to every query, resulting in the error the OP describes, which i am experiencing now as well! there is one table in particular, when i try to browse it or select from it, i get the 1064 error with notes about a query that i am not making. the part where you see ANDverifyOptionID>0
is not part of the query i am making - i am simply clicking the table and attempting to browse it:
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 'ANDverifyOptionID>0
LIMIT 0, 30' at line 1
i suspect something is cached in PHPMyAdmin, but have no idea where to find it and fix it.
i have cleared cookies/restarted and no love. another user was able to view teh table with no issue - so this must be something related to a specific user account.
Does PHPMyAdmin cache something per user that could cause this?
you have missed the name of your table in all queries
SELECT MAX( version ) FROM your_table
^^-----your_table_here
and you dont have to include database or table in where clause . you need to learn the basics of select query.