root用户登录
- 指定用户和密码从任何主机连接到mysql服务器
GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%'IDENTIFIED BY 'mypassword' WITH GRANT OPTION; FLUSH PRIVILEGES;
- 指定用户和密码从指定IP主机连接到mysql服务器
GRANT ALL PRIVILEGES ON *.* TO 'root'@'192.168.13.245'IDENTIFIED BY 'x5' WITH GRANT OPTION; FLUSH PRIVILEGES;