问题描述
有个十几M的sql文件,现在需要导入到mysql中, 如何快递导入
解决方案
命令行进入mysql中,使用source
命令即可.
MariaDB [(none)]> show databases;
+--------------------+
| Database |
+--------------------+
| mytest_db |
| information_schema |
| mysql |
| performance_schema |
+--------------------+
7 rows in set (0.006 sec)
MariaDB [(none)]> use mytest_db;
Database changed
MariaDB [mytest_db]> set names 'utf8';
Query OK, 0 rows affected (0.002 sec)
MariaDB [mytest_db]> source /path/to/sql/run.sql
...
Query OK, 1 row affected (0.000 sec)
MariaDB [mytest_db]> exit
Bye