给MySQL授权远程访问

putty登录服务器;

登录MySQL:

mysql -u root -p

新建远程用户:

CREATE USER myusername IDENTIFIED BY mypassword;

授权:

grant all on *.* to [email protected] identified by mypassword; flush privileges;

101.102.103.104是你的外网ip

现在,你就可以用客户端从远程访问了