Import database backup return #1064 - mysql

Suddenly importing database backup returns the error below.
The odd thing is that importing an old working copy it works.
If I export it straight afterwards and I try to re-import it the file gives this error.
Looks like it's PhpMyAdmin export that causes issue.
Is there any change in PhpMyAdmin export process that I'm not aware of?
This looks like my problem but the solution didn't work for me.
There is a chance that you may have found a bug in the SQL parser.
Please examine your query closely, and check that the quotes are
correct and not mis-matched. Other possible failure causes may be
that you are uploading a file with binary outside of a quoted text
area. You can also try your query on the MySQL command line interface.
The MySQL server error output below, if there is any, may also
help you in diagnosing the problem. If you still have problems or
if the parser fails where the command line interface succeeds, please
reduce your SQL query input to the single query that causes problems,
and submit a bug report with the data chunk in the CUT section below:
----INIZIO CUT----
eNo1jU0KwjAYRIXuvlPMAWIw0SrNLoTQLvJn0roXF1IQ3Sjo7U0FZ/UYHjM255gVjICRcDYoCEgI
QWWsdUPkP+XoFFou+L5b3x5XmkpGLAy6t2FkONkq+vMFZsjR22puuOwoea2wq9xSGtJisViWnS0X
B7j5/nqT06FXmJ/0u6Bm9c8XSs4hPQ==
----FINE CUT----
----INIZIO RAW----
ERROR: C1 C2 LEN: 1 2 11
STR: MySQL: 5.1.69-log
USR OS, AGENT, VER: Mac CHROME 5.0.29
PMA: 4.0.5
PHP VER,OS: 5.3.17 Linux
LANG: it
SQL:
----FINE RAW----
Query SQL:
Messaggio di MySQL:
#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 '' at line 1
(I translated what I could in the error as my phpmyadmin is in Italian)

I had the same problem and I found the solution. Open the sql document with any code editor and at the very end in the last line you will see some black strange codes just delete and save should work as it worked for me.
I'm not sure how and why this code been generated when I exported my database.

You are running an outdated phpMyAdmin version. I believe that the fix mentionned in https://sourceforge.net/p/phpmyadmin/bugs/4095/ (for the upcoming 4.0.8 version) will help you.
Direct link to the fix (can be applied to 4.0.7): https://github.com/phpmyadmin/phpmyadmin/commit/b717657de77db0b58179bdbdd88e23d0fc3d7ea6

Related

Running a MySQL Script - with zero knowledge

A client has just supplied me with two long files which are (apparently) scripts that I can run in MySQL to generate a bunch of database tables.
I've installed MySQL (+ workbench) on my PC. From within the Workbench environment I found "run SQL script" under the File menu so I went with that and tried to run the two script files I have. They both fell over partway though giving me error messages:
Finished executing script
ERROR 2006 (HY000) at line 1930: MySQL server has gone away
Operation failed with exitcode 1
and
Finished executing script
ERROR 2006 (HY000) at line 20201: MySQL server has gone away
Operation failed with exitcode 1
I can however see two schemas, both of which contain a bunch of tables, etc. (some of which are populated) so it seems to have been a partial success at least.
Can anyway suggest what might be wrong please?
Thank you.
I can point you at a solved example on stackoverflow for this MySQL error, but the simplest solution is to edit your sql file(s) placing this query at the top:
set SESSION max_allowed_packet=64*1024*1024

Mysql Error While Importing

I am trying to import Mysql Data taken from Wordpress blog locally on Window 7 system. One way or other it is giving error.
The table wp_commentmeta was giving error. I have deleted all aksimet rows, but still error was coming. So, quit that table and included other tables. But now as well error is coming, which I do not understand:
Error: There is a chance that you may have found a bug in the SQL
parser. Please examine your query closely, and check that the quotes
are correct and not mis-matched. Other possible failure causes may be
that you are uploading a file with binary outside of a quoted text
area. You can also try your query on the MySQL command line interface.
The MySQL server error output below, if there is any, may also help
you in diagnosing the problem. If you still have problems or if the
parser fails where the command line interface succeeds, please reduce
your SQL query input to the single query that causes problems, and
submit a bug report with the data chunk in the CUT section below:
----BEGIN CUT---- eNo1jTsKwzAQRAPu9hRzACEs2S6ynRDCDugXSYlPkCKN+9w+ciBTDY/HjCslFYZVsBreRYaChlJU
W8cDUfjUu2cscpGTpkctSFXArC42gafr0v4+YLeSguvWKKeRcjCMufdZKspbPj2R6rnSyRX7LcZG
3sSV8Trod0DD5Z8vxK4ftA==
----END CUT----
----BEGIN RAW---- ERROR: C1 C2 LEN: 1 2 11 STR: MySQL: 5.5.32 USR OS, AGENT, VER: Win CHROME 5.0.30 PMA: 4.0.4.1 PHP VER,OS: 5.4.19
WINNT LANG: en SQL:
----END RAW---- SQL query: MySQL said: Documentation
#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 '' at line 1
The error is from PHPMyAdmin.
Just a warning message for everyone. I remember, I used to use command line more than any tool like phpMyAdmin. Today phpMyAdmin has taken so many hrs. phpMyAdmin was not exporting correctly and all problem was due to that.
Not even phpMyadmin could import its own exported data. I used mysqldump and then mysql ... db < sql.sql and it worked at lightening speed.
#mysqldump -u userName -p --add-drop-table --insert-ignore --result-file downloads/db_name_dump-oct-14.sql db_name
Then downloaded the file using FileZilla,
and on Wins 7:
>mysql -u root -proot wordpress < db_name_dump-oct-14.sql
Remember, do not give semi-colon at last.
Those characters are an encoded parser report. When decoded with scripts/decode_bug.php, it reports:
ERROR: C1 C2 LEN: 1 2 11
STR:
MySQL: 5.5.32
USR OS, AGENT, VER: Win CHROME 5.0.30
PMA: 4.0.4.1
PHP VER,OS: 5.4.19 WINNT
LANG: en
SQL:
So, it cannot report which SQL statement gave a problem. Maybe your import operation was incomplete, due to some incorrect server settings. See FAQ 1.16 in phpMyAdmin documentation include in your kit, or http://www.phpmyadmin.net/home_page/docs.php.
Check the last line of your .sql file in an editor(Sublime Text or whatever you prefer). Does it have strange characters there? ETXNULLNULLNULLNULL etc. Remove that line and retry your import. Worked for me.
Just want to tack on a note that using TextWrangler I could not see the extra characters or text at the end of the sql document; however, I did see a white space, so I selected and deleted it, then saved. When I then imported into the database, the error disappeared! So take heart, Mac users, or rather TextWrangler users, who might have been mystified by the missing characters.

How download DB MySQL on hosting?

This first that I try to download DB MySQL on "godaddy", but I receive this message:
Error
There is a chance that you may have found a bug in the SQL parser. Please examine your query closely, and check that the quotes are correct and not mis-matched. Other possible failure causes may be that you are uploading a file with binary outside of a quoted text area. You can also try your query on the MySQL command line interface. The MySQL server error output below, if there is any, may also help you in diagnosing the problem. If you still have problems or if the parser fails where the command line interface succeeds, please reduce your SQL query input to the single query that causes problems, and submit a bug report with the data chunk in the CUT section below:
----BEGIN CUT----
eNrt2c1OwkAUBeBDAQODiSyI67tgYwKlLYLQlRXLXwrUFnFpTERDJIUYMfI6PoHv4HtRp01Al26M
Jt4vM5mb07kzyWxre97IM6mlU8sgxx6apJFOjbrWFP5YftgI4U9kWuzdFsVg7V84JtVUTW3Wy/PF
vbj0PRr5JbI69nBcooktW65mAflW2/J68c5a9US4A8skQ9X1aFSF23WjraWRHx2mq3VyZsHqRTjW
sGPSNCivnu7KDRFftkmI/SSQTwCaXNDFjpJBFkhHZWab5eV8ewfENqhUAAJjjDHGGGOMMcb+OgXh
D5y6h14QLM7P+H0ZY4wxxhhjjLHf9pqI/+n/Wwko6KMtqy4Od6m7q/tIKkrhiL4JKWSXj4vl9cN0
jTRycf18M19NkcoahrwOOJXzIAOkc4UCjr8E4bYz/GwL8QHyNkoe
----END CUT----
----BEGIN RAW----
ERROR: C1 C2 LEN: 0 1 8609
STR: �
SVN: $Id$
MySQL: 5.0.96-log
USR OS, AGENT, VER: Win SAFARI 5.0.537
PMA: 2.11.11.3
PHP VER,OS: 5.1.6 Linux
LANG: en-utf-8
SQL: �
0H ��
// �InnoDB�JFHPJ) prop_keyprop_value 22#4#�prop_key�prop_value�
----END RAW----
SQL query:
� 0H �� // �InnoDB�JFHPJ) prop_keyprop_value 22#4#�prop_key�prop_value�
MySQL said: Documentation
#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 'þ
' at line 1
What did wrong I do? I thing this is because version of MySQL, I changed from 5.6 to 5.0.96 and created new table, but receive same result.

Error code 1064, SQL state 42000: You have an error in your SQL syntax;

I'm using latest version of MySQL ==> mysql-5.6.10-winx64.zip
Created the database and every thing is ok 'I think'
when I try to execute this simple command;
"select * from family"
I got this error :
Error code 1064, SQL state 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 'OPTION SQL_SELECT_LIMIT=DEFAULT' at
line 1
I've spent much time searching for a solution but no solution was found :(
That looks like an error coming from a JDBC driver. When the JDBC driver initializes the connection, it sends several commands to the MySQL server, one of which is:
SET OPTION SQL_SELECT_LIMIT=DEFAULT
The problem is that the SET OPTION syntax has been deprecated for some time and is now no longer valid in MySQL 5.6. Here's a relevant bug conversation from MySQL's bug database:
Bug #66659: mysql 5.6.6m9 fails on OPTION SQL_SELECT_LIMIT=DEFAULT
Try upgrading your JDBC MySQL driver. The bug conversation lists some other options in case upgrading the driver is not an option.
I followed the instructions above and this worked for me!
Download latest jar file from here:
http://dev.mysql.com/downloads/mirror.php?id=412737
Unzip it
Copy jar file "mysql-connector-java-5.1.25-bin.jar"
to this folder: C:\Program Files\NetBeans 7.3\ide\modules\ext
In Netbeans IDE: Disconnect from database.
Click Services. Expand Drivers. Right-click on MySQL and press Customize.
Add latest driver
Remove previous driver.
Re-connect to dabatase within IDE.
I had the same problem few weeks back. Followed the following steps and it very much resolved the issue.
Copied the latest version (mysql-connector-java-5.1.23-bin) of the jar file to ..\NetBeans 7.3\ide\modules\ext. My earlier version of the driver was mysql-connector-java-5.1.18-bin.
Change the driver version within NetBeans IDE. In the IDE's Services window, expand Drivers -> right-click on MySQL (Connector/J driver) and select Customize. Remove the earlier driver and point it to the latest one (C:\Program Files (x86)\NetBeans 7.3\ide\modules\ext\mysql-connector-java-5.1.23-bin.jar). Click ok and restart IDE.
This should resolve the problem.
If the driver suggestion does not work, check your sql for unprintable characters. I just spent an hour troubleshooting this issue only to discover a hidden u+200b character at the end of my sql statement.
I got the same Error when i was dumping mysql table structure file in to DB. Mistake was putting the Syntax for dropping all table before but not checking their existence in the Database.
Issue was at " DROP TABLE usermgmt".
I removed that code of lines of dropping tables and it proceeded with out any error this time.
I prefixed the name of the table with the database name such as
select * from database_name.table_name;
and it worked perfectly, so most likely there's a name conflict.

OpenCart on Windows XP Error

I'm trying to install Open Cart on my virtual machine with, PHP 5.4.7, MySQL 5.5 and Apache 2.2. After A LOT of troubles, I've managed to arrive at the moment of installation script execution, but I receive this problem:
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 '/*!40101 SET #OLD_CHARACTER_SET_CLIENT=##CHARACTER_SET_CLIENT */' at line 1
Honestly I'm stuck. I've tried to execute the code in Workbench and it works, except that in the INSERT INTO queries for test data they've missed default values for NOT NULL columns.
Hints? Suggestion?
Those random characters at the start of the SQL are the UTF Byte Order Mark. Something you used to edit the file decided to emit that at the start. Quickest way to get rid of it would be getting Notepad++, open the file in that, Select "Encoding->Enocde in UTF-8 without BOM", and resave the file, and try again.