2018.12.31 23:18 MySQL学习中
PHP和MySQLWeb开发第四版
关于命令行运行现有的sql文件问题
D:\wamp\bin\mysql\mysql5.7.23>mysql -h localhost -u bookorama -D books -p < bookorama.sql
系统找不到指定的文件。
D:\wamp\bin\mysql\mysql5.7.23>cd bin
D:\wamp\bin\mysql\mysql5.7.23\bin>mysql -h localhost -u bookorama -D books -p < D:\zyWEB\SQLjb\bookorama.sql
Enter password: ************
ERROR 1050 (42S01) at line 1: Table 'customers' already exists
D:\wamp\bin\mysql\mysql5.7.23\bin>mysql -h localhost -u bookorama -D books -p < D:\zyWEB\SQLjb\bookorama.sql
Enter password: ************
ERROR 1064 (42000) at line 8: 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 'data not null
)' at line 6
D:\wamp\bin\mysql\mysql5.7.23\bin>mysql -h localhost -u bookorama -D books -p < D:\zyWEB\SQLjb\bookorama.sql
Enter password: ************
ERROR 1050 (42S01) at line 1: Table 'customers' already exists
D:\wamp\bin\mysql\mysql5.7.23\bin>mysql -h localhost -u bookorama -D books -p < D:\zyWEB\SQLjb\bookorama.sql
Enter password: ************
D:\wamp\bin\mysql\mysql5.7.23\bin>
经过无数次尝试与纠结,一开始提示权限不够,很无语,记得上次创建 bookorama
这个账户时应该给了他权限的,然后又开 mysql
控制台重新给权限然后再来命令行继续敲命令,又发现 sql
文件中写错了,然后又改,最终是成功了。QAQ