两步开启远程连接

一,登录mysql

# mysql -uroot -p

二,配置远程连接

mysql > GRANT ALL PRIVILEGES ON *.* TO 'user1'@'%'IDENTIFIED BY 'mypassword';


mysql > GRANT ALLPRIVILEGES ON *.* TO 'root'@'%';

mysql > FLUSH PRIVILEGES;