mysql之导入数据

linux 命令行导入数据

将sql文件放到登录mysql库的命令的当前目录下

[root@izwz91h49n3mj8r232gqwez opt]# mysql -u root -p 
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 49
Server version: 5.6.42-log MySQL Community Server (GPL)

Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> CREATE DATABASE IF NOT EXISTS yiibaidb DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
mysql> use yiibaidb;
mysql> source yiibaidb.sql;

备注 yiibaidb.sql 都是yiibaidb这个数据库里的表以及数据

猜你喜欢

转载自blog.csdn.net/u014636209/article/details/84851505