1、在/etc/mysql/my.cnf中的[mysqld]段注釋掉bind-address = 127.0.0.1
2、用mysql -uroot -p 登陸mysql,然後采用以下方法開啟遠程訪問權限:
方法1:mysql>use mysql;
mysql>update user set host = '%' where user = 'root';
mysql>FLUSH RIVILEGES;
方法2:mysql>GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;