Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/shell/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用shell脚本将多个sql文件自动导入同一个mysql数据库_Mysql_Shell - Fatal编程技术网

如何使用shell脚本将多个sql文件自动导入同一个mysql数据库

如何使用shell脚本将多个sql文件自动导入同一个mysql数据库,mysql,shell,Mysql,Shell,使用shell脚本将Sql文件转换为mysql数据库。 我还有十个.sql文件。但是所有.sql文件都导入到同一个数据库中。 .sql文件采用.gz格式 bash: for sql_file in *.sql; do mysql db_name < $sql_file; done 用于*.sql中的sql\u文件;做mysql db_name

使用shell脚本将Sql文件转换为mysql数据库。 我还有十个
.sql
文件。但是所有
.sql
文件都导入到同一个数据库中。
.sql
文件采用
.gz
格式

bash

for sql_file in *.sql; do mysql db_name < $sql_file; done
用于*.sql中的sql\u文件;做mysql db_name<$sql_文件;完成

(假设您希望导入当前目录中的所有sql文件)

使用google。这不是你能找到申请的地方。