mysql的远程备份

使用服务器进行远程数据库备份时报错:
[root@zfer13 ~]# mysqldump -u root -p111111 -h 192.168.1.163 --databases test >/tmp/test.sql
mysqldump: [Warning] Using a password on the command line interface can be insecure.
报错信息是不能在界面上输入密码,为了安全
可以使用如下方法进行远程机器备份:
1.手动输入密码
mysqldump -u root -p -h 192.168.1.163 --databases test >/tmp/test.sql
2.用了参数,如果访问时会出个警告可以丢到系统null中
mysqldump --defaults-extra-file=/etc/my.cnf -h 192.168.1.163 -uroot -p111111 test > test11.sql 2>/dev/null

猜你喜欢

转载自blog.51cto.com/7794482/2444589