设置mysql 的远程连接
mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;
mysql>FLUSH PRIVILEGES;
mysql>exit;
*.*
第一个*
表示允许远程连接的数据库名称,*
代表允许所有数据库;第二个*
表示允许远程连接数据库中表的名称,*
代表允许所有表。
root@'%'
表示允许连接的用户和主机。这里表示允许root用户,后面的%
表示允许所有的主机连接。
BY 'password'
中的password
表示用于远程连接的密码。