MySQL5.6版本备份报错,密码不安全

[root@centos199 mysql]# mysqldump -uroot -ppassword cz-office > mysql38.sql
Warning: Using a password on the command line interface can be insecure.

解决方法1:进行交互式输入密码,

[root@centos199 mysql]# mysqldump -uroot -p cz-office > mysql38.sql

会让你输入MySQL用户root的密码,

解决方法2:在配置文件my.cf里面添加一下内容:

[mysqldump]
user=root
password=password

保存退出,从新启动mysql

备份的时候可以省略不输入用户名和密码就可以;如果是备份的脚本的话,也一样;

[root@centos199 mysql]# mysqldump cz-office > mysql38.sql

 

相关文章:

  • 2021-12-04
  • 2021-07-25
  • 2022-12-23
  • 2021-09-07
  • 2021-07-22
  • 2022-12-23
  • 2021-12-30
  • 2021-11-25
猜你喜欢
  • 2021-11-09
  • 2021-06-26
  • 2022-12-23
  • 2022-03-07
  • 2021-08-28
  • 2021-08-12
  • 2021-12-30
相关资源
相似解决方案