#授权

#授权只读(mysql 5.7)
grant select on *.* to 'zabbix'@'localhost' identified by 'zabbix';

#授权读写所有权限(mysql 5.7)
grant all privileges on zabbix.* to 'zabbix'@'192.168.40.131' identified by 'mysqlZ125!' ;

grant all privileges on *.* to 'root'@'192.168.40.1' identified by '123456' ;

flush privileges;
1
2
3
4
5
6
7
8
9
#授权所有用户连接
#mysql 5.7
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'youpassword' WITH GRANT OPTION;

#mysql 8.0
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '123456';

flush privileges;