0
votes

I always use these methods to upload my database file from local to phpmyadmin :

  1. Get the .sql file from localhost phpmyadmin
  2. Open that in notepad and change localhost to www.sitename.com
  3. Finally import that .sql file to the site's phpmyadmin

It always worked great without any problems. But this time when I want to import that .sql file it gives me this error :

Error

SQL query: phpMyAdmin SQL Dump

-- version 3.4.10.1

-- http://www.phpmyadmin.net

Host: localhost -- Generation Time: Mar 30, 2015 at 12:05 PM

-- Server version: 5.5.20

-- PHP Version: 5.3.10

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 'phpMyAdmin SQL Dump

-- version 3.4.10.1

http://www.phpmyadmin.net

Host:' at line 1

This time it gives me this error. How I can Fix that?

Thanks

2
post few lines from your .sql file. Basically all non executable statements should be commented in the script file. It seems your file lacks them. - Ravinder Reddy
What is the size of .sql file, what version are you using to import sql dump and what was previous version of` mysql` . - Altmish-E-Azam
@MiyaG 253 kb. What should I do? - afrooz hashemzadeh
Okay there are two things.. one is that you want only upload sql data to mysql OR you want to identify the issue ? Here what is your purpose? - Altmish-E-Azam
@MiyaG Import sqldata to mysql. that's all - afrooz hashemzadeh

2 Answers

0
votes

As previous discussion. Just open sql file in any text editor and remove all host lines and simply copy the data below the line

 -- 
 -- Table structure for table 
 --

and paste the same on MySQL terminal and try.

Also you can use mysqldump command through shell or command prompt.

0
votes

I found similar error and by looking inside file i saw

2006 - MySQL server has gone away

that mean mysql was not able to execute query completely

you can try tables export one by one or using phpmyadmin