Home
 

Customer Support

Search for keywords:

Browse by category:

Why do i get a query syntax error 1064 from MySQL when the syntax seems correct?

You will get a MySQL query syntax error number 1064 when you incorrectly use a reserved word in your query such as "when" or "order".

MySQL 4 has additional reserved words that you cannot use and the full list of them is at http://www.mysql.com/doc/en/Reserved_words.html.

User-Contributed Notes

add a note
nitin.kaul -at- yahoo.com
29-Jun-2006 06:18
The error 1064 occurs due to Mysql version mismatch,because differnt
versions have differnt 
reserved words,which if used by a previous version causes the error to
occur.

The simplest and most effective solution for it is.
-when using phpMyadmin,select the "compatibility mode" & select the
target db version from the drop down box.
-when using MySql administrator,while backing up  choose  "compatibility
mode" in adavanced tab ,
and while restoring through mysql administrator ,click  "auto-detect
file charater set" if backup was not made using mySql administrator.
the default file characer set used by mysql admministrator is utf8.

Taking these precautions, generally should get the things working for
you.
however there maybe some exceptions to this solution.
In that case you will have to see the error it is giving .
say for eg, in my case error was 
-------------------------------------------------
Error Code : 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 'DEFAULT CHARSET=latin1
-------------------------------------------------
Here i could replace latin1 with utf8,
because my target version of mysql was different from the from which i
took backup.
-------------------------------------------------
In case of other serious errors you may 
search mysql forums

Adios,
Nitin Kaul


 

add a note

Related Questions:


How do I import delimited data into MySQL?

How do I change my MySQL password?

How do I import a MySQL dumpfile into my database?

How can I export data in CSV or tab delimited format?

How do I connect to my MySQL database?

How do I export and move my database tables between servers or copy databases?

I can't connect to local MySQL server through socket 'mysql.sock'

How do I create a .my.cnf MySQL preference file?

What is my database server name?

How do I change MySQL timezone?

What is my MySQL Username or Database Name?

MySQL says I have too many connections.

How do I check how much disk space my database is using?

A MySQL MYI table has errors in it.

Can I connect to MySQL remotely?

Can I connect to my MySQL database from my own computer?

I can't get phpMyAdmin to work.

phpMyAdmin gives SQL syntax error when I try to create table.

How can I use odbc_connect() in my PHP scripts to connect to MySQL?

What kind of database server do you offer?

How many databases do I get?

What am I allowed to do with my MySQL database?

Will we be able to do our own MySQL admin?

How do I import a MySQL dumpfile into my database via phpMyAdmin?

Do you offer MySQL 5?

How do I export a MySQL dumpfile via phpMyAdmin?

Browse Categories:

Getting Started, FTP, Telnet/SSH, Moving Domains, E-mail, Traffic Reports, Mailing Lists, Apache, PHP, CGI, Other Server-Side Scripting, MySQL Database, Imaging Libraries, Other Software, Billing & Terms, Control Panel, E-commerce, Pre-Sales


Tiny Modwest Logo         Copyright 2000-2008 by Modwest, Inc.          About Us    |    Blog    |    Jobs    |    Web Design    |    Contact Us