wp-migrate-db
wp-migrate-db copied to clipboard
Error in Windows path separator '\' when import .sql file in phpMyAdmin
Hi, I noticed that in when you migrate db to Windows, for example:
/srv/mywebsite → C:\xampp\htdocs\mywebsite
When you go to import in phpMyAdmin, it throws this error:
Static analysis:
12 errors were found during analysis.
Unexpected character. (near "\" at position 0)
Unexpected character. (near "\" at position 1)
Unexpected character. (near "\" at position 2)
Unexpected character. (near "\" at position 3)
Unexpected character. (near "\" at position 4)
Unexpected character. (near "\" at position 5)
Unexpected beginning of statement. (near "\" at position 0)
Unexpected beginning of statement. (near "\" at position 1)
Unexpected beginning of statement. (near "\" at position 2)
Unexpected beginning of statement. (near "\" at position 3)
Unexpected beginning of statement. (near "\" at position 4)
Unexpected beginning of statement. (near "\" at position 5)
Comando SQL:
\\\\\\ /*!40101 SET NAMES utf8mb4 */
Mensagens do MySQL : Documentação
#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 '\\\\\\
/*!40101 SET NAMES utf8mb4 */' at line 1
But when you remove the line within .sql:
Path: C:\\xampp\\htdocs\\mywebsite
The import becomes successful, but I didn't realise yet why PMA blocks commented '\' separator. Regards,