大型SQL数据库包含如何处理和导入的语法错误

I have a .sql file created by wordpress but my wordpress site is removed. I have that file left and I want to insert that .sql file into my localhost phpmyadmin to retrieve some precious posts. the sql file size is 76.4MB. I used following steps to upload to phpmyadmin:

  1. Created new database
  2. Used "import" tab and selected "Select from the web server upload directory C:\xampp\sql/" and selecting my db localhost.sql from dropdown menu (I previously saved it in directory c:\xampp\sql"

  3. Clicked on "Go" and it took a huge time.

  4. After that this error appeared :
Error
Static analysis:

3 errors were found during analysis.

Unexpected character. (near ":" at position 60)
Unexpected character. (near ":" at position 1331)
Unrecognized statement type. (near "div" at position 7)
SQL query:

<! <div class="error"><h1>Error</h1> <p><strong>SQL query:</strong> <a

href="tbl_sql.php?sql_query=SHOW+TABLE+STATUS+FROM+%60science1_skddb1%60+LIKE+%27wp_term_relationships%27&show_query=1&db=&table=wp_term_relationships&token=2e9a4a0af3236e955c1ab3f62da2e8b4"> Edit

SHOW TABLE STATUS FROM science1_skddb1 LIKE 'wp_term_relationships'

MySQL said:


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 '

Error

SQL query:

The problem is that I cannot open a huge file in notepad and remove the syntax errors manually. What should I do now I want to import that database and retrieve some info.

I'm pretty sure most decent code editors can handle 73mb files without trouble unless you are running on a very old machine. I would try komodo edit or sublime and see if they can handle. If that doesn't work, assuming you are working on a linux machine you can upload it to the server and edit using vim, that can handle it no problem.

Your error data presented is a little confusing though...did you urldecode the sql query from the table data? Maybe I'm reading it wrong but your input doesn't care about syntax of urlencoded data, its the query that matters.

Also, I'm sure phpmyadmin has settings that can be adjusted during import, you might want to look into that.