为了远程连接,您必须使MySQL将端口3306绑定到my.cnf中计算机的IP地址。然后,您必须同时在localhost和’%’通配符中创建用户,并在所有DB上授予权限
。 见下文:
my.cnf(在Windows上为my.ini)
#Replace xxx with your IP Address bind-address = xxx.xxx.xxx.xxx
然后
CREATE USER 'myuser'@'localhost' IDENTIFIED BY 'mypass';CREATE USER 'myuser'@'%' IDENTIFIED BY 'mypass';
然后
GRANT ALL ON *.* TO 'myuser'@'localhost';GRANT ALL ON *.* TO 'myuser'@'%';flush privileges;
根据您的操作系统,您可能必须打开端口3306才能允许远程连接。



