Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Existing MySQL database is not importing to localhost

I am getting this error when I am trying to import my existing database to localhost. The database imports to web host servers but importing to the localhost.

The error is;

Static analysis:

2 errors were found during analysis.

Ending quote ' was expected. (near "" at position 28310)
4 values were expected, but found 3. (near "(" at position 28266)
like image 762
Zaqir Hossan Avatar asked Oct 25 '15 11:10

Zaqir Hossan


2 Answers

This might happen because the database - size that you export is too big.

THE SOLUTION FOR ME WAS:

Choose from Export method:

Custom - display all possible options

Format: SQL

Output:

In Compression - choose the option zipped

export the database as zip , (ex: database_name.sql.zip) import it on local, and from time to time if it throws an error for taking too long , you can resume the import, by press on resume and resubmit - and choose again the same database and will continue from where stopped before.

I attached a picture with these settings:

enter image description here

like image 108
Adrian Berca Avatar answered Nov 13 '22 18:11

Adrian Berca


PhpMyAdmin is kinda dumb since it cannot import what it itself exported. It escapes single quotes as '' instead of \' and then breaks its teeth on strings like this:

''I can''t do this anymore!''

You can either:

  • replace ''\', or
  • import via mysql.exe:

    mysql -uuser -ppass dbName < file.sql
    
like image 15
dwelle Avatar answered Nov 13 '22 18:11

dwelle