在 Navicat for MySQL:
mysql> SHOW DATABASES;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| xsk |
| ybbook |
+--------------------+
5 rows in set
mysql> USE xsk;
Database changed
mysql> SOURCE D:/xsk.sql;
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SOURCE D:/xsk.sql' at line 1
在cmd 可以成功,但是也提示有error:
mysql> SHOW DATABASES;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| xsk |
| ybbook |
+--------------------+
5 rows in set (0.01 sec)
mysql> USE xsk;
Database changed
mysql> SOURCE D:/xsk.sql;
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
/*此处重复多个,为了让看官看起来方便,所以删除了.*/
Query OK, 2 rows affected (0.00 sec)
Records: 2 Duplicates: 0 Warnings: 0
Query OK, 0 rows affected (0.00 sec)
/*此处重复多个,为了让看官看起来方便,所以删除了.*/
Query OK, 0 rows affected (0.00 sec)
mysql>
请问解决呢?谢谢了!
首先保证文件和mysql是在同一机器,再执行source命令,检查文件所在目录是否正确