11

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)
2
  • 1
    You should check if the file has been truncated. Looks like maybe the file has ended earlier than expected. Commented Oct 25, 2015 at 12:19
  • Thanks Nick, I opened the file with notepad and everything is there. There is a note under the page, but could not fine the "appkey" in mentioned line number. Its in the notepad in another line but not sure what to do with it. MySQL said: Documentation #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''a:5:{s:6:"appkey"' at line 148 Commented Oct 25, 2015 at 13:13

3 Answers 3

15

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
    
Sign up to request clarification or add additional context in comments.

2 Comments

I just spent a good half hour trying to import a .sql dump via phpmyadmin and it kept failing etc - did it in like 5 minutes using the console including the time it took me to add mysql to the windows path variable...
In my case, wordpress comments that contained apostrophes such as client's were being escaped with \' which was breaking the syntax for importing into a local phpMyAdmin database. tl:dr; replace \'\"
1

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

2 Comments

Can you specify whats 'old' and 'new' version?
honestly speaking i search it from forum where nothing was mention about version so i tried both method one by one and luckily one works for me
1

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.