windows网上下载sql文件并导入MySQL
首先找到mysql\bin:
例如:C:\Program Files\MySQL\MySQL Server 5.7\bin
然后cmd
登入sql:mysql -u root -p --default-character_set=utf8
导入sql文件:source "sql文件存在的绝对路径"
tips:文件路径一定是/
此时还是补成功,因为说是不能read XXX.dump
因为employees.sql中导入其他表的语句是:
SELECT 'LOADING departments' as 'INFO';
source E:/springboot/test_db-master/load_departments.dump ;
SELECT 'LOADING employees' as 'INFO';
source E:/springboot/test_db-master/load_employees.dump ;
SELECT 'LOADING dept_emp' as 'INFO';
source E:/springboot/test_db-master/load_dept_emp.dump ;
SELECT 'LOADING dept_manager' as 'INFO';
source E:/springboot/test_db-master/load_dept_manager.dump ;
SELECT 'LOADING titles' as 'INFO';
source E:/springboot/test_db-master/load_titles.dump ;
SELECT 'LOADING salaries' as 'INFO';
source E:/springboot/test_db-master/load_salaries1.dump ;
source E:/springboot/test_db-master/load_salaries2.dump ;
source E:/springboot/test_db-master/load_salaries3.dump ;
source E:/springboot/test_db-master/show_elapsed.sql ;
一定要注意,原文没有加上绝对路径,这里自己加上绝对路径,并且,分隔符 /
就可以了。
参考: