1. Log mysql
数据库ip 用户 密码
mysql -h127.0.0.1 -uroot -proot123
2, select the database
数据库名称
use mysqldemo;
3, import data
1. sql file uploaded to the server directory
2. Execute the sql file
source /home/yiqingsystem/yiqingsystem-2002282218.sql;
#第二种方法 mysql -u用户名 -p密码 数据库名 < 数据库名.sql
mysql -h127.0.0.1 -uroot -proot23 yiqingsystem < /home/yiqingsystem/yiqingsystem-2002282218.sql;
4, export data
Export Table and Table 1. The data structure
mysqldump -h127.0.0.1 -uroot -proot23 yiqingsystem >/home/mysqlBackups/yiqingsystem/yiqingsystem-20202285447.sql
2. Export table structure
mysqldump -h127.0.0.1 -uroot -proot23 -d yiqingsystem >/home/mysqlBackups/yiqingsystem/yiqingsystemtable-20202285447.sql