Mysql:备份提示Using a password on the command line interface

问题:

使用mysqldump备份警告:Warning: Using a password on the command line interface can be insecure.

原因:

mysql 5.6版本之后,使用 mysqldump dbName -r - p > backup.sql 会报警告。官方解释是因为安全原因。

解决办法:

  1. 找到my.ini文件
  2. 将以下代码写入文件:
	[mysqld]
	port = 3306
	sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES 
	skip-grant-tables
	[client]
	host=localhost
	user=root
	password=root
  1. 在原有的基础上添加client部分,文件中user与password参数根据自己实际情况更改;
  2. 备份语句更改为:mysqldump --defaults-extra-file=my.ini shop > d:\time_2018-11-13_18-32-15.sql
  3. file后的路径为你的my.ini文件的路径

猜你喜欢

转载自blog.csdn.net/u011374582/article/details/84033867
今日推荐