openEuler 安装MySQL8并设置空密码
openEuler 安装MySQL8并设置空密码
1,主机安装haproxy后,与后端mysql代理实现负载均衡,需要在haproxy中添加后端检查,并在mysql中添加一个空密码账号。
具体操作命令如下:
mysql> CREATE USER `haproxy`@`%` IDENTIFIED WITH mysql_native_password BY '123fdafdaf' PASSWORD EXPIRE NEVER;
mysql> GRANT ALL ON *.* TO 'haproxy'@'%' with grant option ;
mysql> grant system_user on *.* to root;
mysql> UNINSTALL COMPONENT 'file://component_validate_password';
mysql> ALTER USER 'haproxy'@'%' IDENTIFIED BY '';
mysql> flush privileges;
2,如执行遇到此报错: 1227 - Access denied; you need (at least one of) the SYSTEM_USER privilege(s) for this operation
需要执行此命令: grant system_user on *.* to root;
3, 如mysql有密码策略,需要关闭密码策略。
mysql> UNINSTALL COMPONENT 'file://component_validate_password';
- 点赞
- 收藏
- 关注作者
评论(0)