mysql 备份数据 ,创建远程用户

mysql 备份数据 ,创建远程用户
//备份数据
mysqldump -uroot -p databaseName > name.sql
//备份所有数据
mysqldump -uroot -p  --all-databases > alldata.sql



创建远程用户 :ubuntu 18.04 mysql 5.7

 ## 注意修改 mysql 配置远程

   nano /etc/mysql/mysql.conf.d/mysql.cnf

   注释以下行

   #### bind-address           = 127.0.0.1


   create user userName identified by 'password123'; //创建

   grant all privileges on *.* to 'userName'@'%'identified by 'password123 with grant option; //授权

   flush privileges ;  //刷新权限


 may run:  sudo service mysql restart

© GVGNN 2013-2026