Mysql Dump SQL文件导入数据库
Mysql Dump SQL文件导入数据库

先在数据库服务器用Mysq命令连接上数据库

mysql --default-character-set=utf8  -uroot -p

>use yourdb;

>source /yourdb.sql

 

查看数据库

>show databases;

>use yourdb;

>show tables;

 

修改数据库用户权限

mysql> alter user 'otheruser'@'%' identified by 'password';

>update user set host='%' where user='otheruser' and host='localhost';
>flush privileges;

 

导出数据库

mysqldump -h127.0.0.1 -P3306 -uroot  -p123456 --default-character-set=utf8 yourdb_name> /home/db_bak/yourdb.sql 

发布时间:2022-09-18 00:00:00 关键词:mysqldump mysql 浏览量:0