由網路上得知:
1. 只有本機才能使用root登入
2. 若需要遠端連線,須開啟User遠端連線的權限
方法:
#mysql -h localhost -u root -p #登入MySQL
create user '[username]'@'[remote_ip]' identified by '[password]';
grant all on *.* to '[username]'@'[remote_ip]';
[username] : 帳號
[password] : 密碼
[remote_ip] : 遠端連到MySQL的IP,若不指定則填"%"
mysql>create user 'jesse'@'%' identified by '1234';
mysql>grant all on *.* to 'jesse'@'%';
mysql>grant all on *.* to 'jesse'@'%';
#skip-networking
#bind-address = 127.0.0.1
#bind-address = 127.0.0.1
#mysql -h 192.168.11.200 -u root -p #登入MySQL
沒有留言:
張貼留言