Mysqldump Syntax Error
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about error 1064 mysql 42000 mysql import Stack Overflow the company Business Learn more about hiring developers or posting ads with
Error 1064 Mysql 42000 Restore
us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is error 1064 mysql 42000 you have an error in your sql syntax a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Syntax error in mysqldump command up vote 2 down vote favorite mysqldump mydatabase
Mysqldump You Have An Error In Your Sql Syntax
< /my/path/to/sqlfile.sql; This is my command issued. What could be the cause of this syntax error, i'm pretty sure its correct. I am trying to load an sql file to my database. mysql sql database share|improve this question edited Aug 29 '13 at 5:00 Digital Alchemist 1,6551714 asked Aug 29 '13 at 4:54 Belmark Caday 5881824 Plese check the syntax in my answer! –Digital Alchemist Aug 29 '13 stats_persistent 0 at 5:00 add a comment| 3 Answers 3 active oldest votes up vote 4 down vote use mysqldump -u username -p databasename > filename.sql to export and mysql -u username -p databasename < filename.sql to import Please refer: http://dev.mysql.com/doc/refman/5.6/en/mysqldump.html share|improve this answer edited Mar 7 '14 at 20:55 Brad Larson♦ 150k36333499 answered Aug 29 '13 at 5:01 Sathish D 2,9861628 add a comment| up vote 2 down vote Synatax of MySQL dump command is : mysqldump -u -p > In your case if the username is root then : mysqldump -u root -p mydatabase > /my/path/to/sqlfile.sql; share|improve this answer answered Aug 29 '13 at 5:05 PSSR 135413 add a comment| up vote 1 down vote This might work out! backup: # mysqldump -u root -p[root_password] [database_name] > dumpfilename.sql restore:# mysql -u root -p[root_password] [database_name] < dumpfilename.sql example mysql -u root -ptmppassword databaseName < /tmp/fileName.sql share|improve this answer answered Aug 29 '13 at 4:57 Digital Alchemist 1,6551714 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook Sign up using Email and Password Post as a guest Name Email Post as a guest Name Email discard By posting your answer, you agree to the privacy poli
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of
Error 1064 Mysql 42000 Create Table
this site About Us Learn more about Stack Overflow the company Business Learn
Mysqldump Access Denied
more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question mysqldump couldn t execute set option sql_quote_show_create 1 x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up http://stackoverflow.com/questions/18502556/syntax-error-in-mysqldump-command While importing mysqldump file ERROR 1064 (42000) near '■/ ' at line 1 up vote 6 down vote favorite 5 Cannot import the below dump file created by mysqldump.exe in command line of windows /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `attachment_types` ( `ID` int(11) NOT NULL AUTO_INCREMENT, `DESCRIPTION` varchar(50) DEFAULT NULL, `COMMENTS` varchar(256) DEFAULT NULL, http://stackoverflow.com/questions/21752550/while-importing-mysqldump-file-error-1064-42000-near-at-line-1 PRIMARY KEY (`ID`), UNIQUE KEY `UK_ATTACHMENT_TYPES___DESCRIPTION` (`DESCRIPTION`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1; While importing the file in command line mysql --user=root --password=root < mysqldumpfile.sql It throws error ERROR 1064 (42000) near ' ■/ ' at line 1 Somebody please help me. mysql windows mysqldump share|improve this question edited Mar 16 at 4:47 asked Feb 13 '14 at 11:12 Pavan Kumar N 1171115 1 did you try to change your CHARSET? maybe use UTF8_general_ci –marcosh Feb 13 '14 at 11:13 @marcosh thank you for pointing me to that. I found the solution. Refer to my answer. –Pavan Kumar N Feb 13 '14 at 14:26 add a comment| 3 Answers 3 active oldest votes up vote 14 down vote accepted Finally I got a solution We need two options --default-character-set=utf8: This insures UTF8 is used for each field --result-file=file.sql: This option prevents the dump data from passing the through the Operating System which likely does not use UTF8. Instead it passes the dump data directly to the file specified. Using these new options your dump command would look something like this: mysqldump -u root -p --default-character-set=utf8 --result-file=database1.backup.
log in tour help Tour Start here for a quick overview of the site Help Center Detailed http://dba.stackexchange.com/questions/142763/trying-to-restore-sql-file-from-mysqldump-results-in-syntax-error answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Database Administrators Questions Tags Users Badges Unanswered Ask Question _ Database Administrators Stack Exchange error 1064 is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up error 1064 mysql and rise to the top Trying to restore SQL file from mysqldump, results in syntax error up vote 2 down vote favorite I ran the following sqldump call in a MySQL 5.7 instance (Windows OS): mysqldump --skip-lock-tables --single-transaction --flush-logs --hex-blob --master-data=1 --routines -A > ~/dump.sql I copied the result in a MySQL 5.7 instance (Linux OS), and executed it via: mysql -uroot -pMyPwd < dump.sql But I got the following error: ERROR 1064 (42000) at line 813: 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 '917,0.31000000,267.21000000,'2015-07-08 17:44:39',88758,'BK1','BK1',49208,4921' at line 1 There are some characters in the error message that I haven't been able to copy, so I paste an image here: So I open the (big) file in nano, and I find the fragment which has this weird characters: ...(49171,0.87000000,267.28000000,'2015-07-08 17:42:48',88671,'BK1','BK1',49167,49170,63,64,'BK11432145524','BK11432145533','xxxxxx',0,0.00000000,0.00000000,0.00000000,0.00000000),(^T9^R17,0.31000000,267.21000000,'2015-07-08 17: