我在MySQL中创建了一个表,并且使用SQL脚本可以方便地创建所有表和主数据。但是,我尝试了所有可行的方法,但它不允许我这样做。
在命令提示符下,我通过传递
连接到mysql>mysql -localhost -root -p;
mysql> Use MYDB
mysql> source d:\script\test.sql
它给了我一条我不明白的消息,请帮忙。
mysql Ver 14.14 Distrib 5.6.20, for Win64 (x86_64)
Connection id: 22
Current database: oyeohdb
Current user: dms@localhost
SSL: Not in use
Using delimiter: ;
Server version: 5.6.20 MySQL Community Server (GPL)
Protocol version: 10
Connection: localhost via TCP/IP
Server characterset: latin1
Db characterset: latin1
Client characterset: cp850
Conn. characterset: cp850
TCP port: 3306
Uptime: 1 hour 13 min 34 sec
Threads: 1 Questions: 99 Slow queries: 0 Opens: 68 Flush tables: 1 Open tab
les: 61 Queries per second avg: 0.022
--------------
Outfile disabled.
ERROR:
Failed to open file 'D:criptest.sql', error: 2
mysql> SOURCE D:/script/test.sql;
ERROR 1064 (42000): 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 'TYPE=
MyISAM' at line 10
mysql>
答案 0 :(得分:0)
我遇到了类似的问题,并且通过运行
解决了这个问题mysql_upgrade.exe
位于:
...bin\mysql\mysql5.6.17\bin
我希望这个问题适合你。干杯!
答案 1 :(得分:-1)
反斜杠是MySQL在字符串中的转义字符。您应该加倍它或使用正斜杠:
mysql> source d:\\script\\test.sql
mysql> d:/script/test.sql