Slatan-ko
Slatan-ko

Reputation: 266

Error import mysql database

i export my database and export to another computer use phpmyadmin

but it error,

Static analysis:

2 errors were found during analysis.

Unexpected character. (near ":" at position 53) Unrecognized statement type. (near "div" at position 1) SQL query:

<div class="error"><h1>Error</h1><p><strong>SQL query:</strong> <a href="db_sql.php?sql_query=SET+time_zone+%3D+%22%2B00%3A00%22&amp;show_query=1&amp;db=project1&amp;token=9e474724fcd1b27aa482f098f19b22f1"><span class="nowrap"><img src="themes/dot.gif" title="Edit" alt="Edit" class="icon ic_b_edit" />&nbsp

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 <div class="error"><h1>Error</h1><p><strong>SQL query:</strong> <a href="db_sql. at line 1

Upvotes: 3

Views: 13377

Answers (5)

Misbakh Ahmed
Misbakh Ahmed

Reputation: 129

The SQL file you want to import is not a proper correct file, there maybe some issue in yourdb.sql file. Open that file in notepad and take a look.

Upvotes: -1

Imad77
Imad77

Reputation: 49

I had the same problem when I want to migrate my wordpress to a new doamin, so I tried many options; the best one that fixes my problem is trying exporting/importing database using the command line in the terminal.

Export DB: mysqldump -u usernameDB -p name_DB > /home/file.sql
Importing DB: mysql -u username_newDB -p name_newDB < /home/file.sql

NOTICE ALL COMMAND ARE EXECUTED IN TERMINAL not logged in Mysql DB.

Upvotes: 0

Mostafa Husany
Mostafa Husany

Reputation: 21

I hade the same error, and I noticed that mysql didn't export all tables database; still can't figure the reason, but I started to exporting and importing the tables as groups

enter image description here

After exporting the tables, you can import them, without any problems.

Upvotes: 2

Juice
Juice

Reputation: 3063

I too had the same problem even after downloading in the sql form. My problem was with wp_comments table I exported all the other tables and for wp_comments table I just downloaded the structure only then manually inserted the values. My problem got solved

Upvotes: 0

mjoris
mjoris

Reputation: 486

Your export file clearly contains HTML code and not SQL code. Make sure you export your database properly. You can export your database in phpMyAdmin as follows.

  1. Log into phpMyAdmin
  2. Click the database you are working with in the left menu
  3. Click Export in the top menu
  4. Under the Export heading, ensure that all of your tables are selected and that the SQL option is selected.
  5. Ensure the Save as file option (towards bottom of page) is checked.
  6. Click Go
  7. You will be prompted to either open or save the file. Please select the option to save the file.

-- cited from http://www.inmotionhosting.com/support/website/phpmyadmin/export-database-using-phpmyadmin

Upvotes: 1

Related Questions