mysql设置免密登陆

243 阅读1分钟

一、设置mysql登陆用户和密码:

mysql_config_editor set --login-path=root --user=root --host=localhost

二、输入密码:

Enter password:

若密码中包含“#”,请在密码外添加双引号,如:

"test!@#"

三、查看配置的免密登陆用户

mysql_config_editor print --all

四、免密登陆

mysql --login-path=root

五、删除免密登陆配置

mysql_config_editor remove --login-path=root