Zaqir Hossan
Zaqir Hossan

Reputation: 111

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)

Upvotes: 11

Views: 19599

Answers (3)

Adrian Berca
Adrian Berca

Reputation: 289

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

Upvotes: 1

Hassan Saeed
Hassan Saeed

Reputation: 7090

open your .sql script file in any editor(like notepad++) and

You need to replace \'' with \' (for new version of phpmyadmin)

or

You need to replace \' with \'' (for old version of phpmyadmin)

when you will replace it from all content of sql file then it will work for you.

ref:https://stackoverflow.com/a/41376791/2298211

Upvotes: 1

dwelle
dwelle

Reputation: 7284

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
    

Upvotes: 15

Related Questions