改表法
x:\>mysql -u root -pvmware mysql> use mysql; mysql> flush privileges; |
授权法
mysql> GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION; mysql> GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'192.168.1.3' IDENTIFIED BY 'mypassword’ WITH GRANT OPTION; |
二:允许用户myuser从ip为192.168.1.3的主机连接到mysql服务器,并使用mypassword作为密码;