remote-access

Mysql adding user for remote access

谁说我不能喝 提交于 2019-11-26 02:39:46
问题 I created user user@\'%\' with password \'password . But I can not connect with: mysql_connect(\'localhost:3306\', \'user\', \'password\'); When I created user user@\'localhost\' , I was able to connect. Why? Doesn\'t \'%\' mean from ANY host? 回答1: In order to connect remotely you have to have MySQL bind port 3306 to your machine's IP address in my.cnf. Then you have to have created the user in both localhost and '%' wildcard and grant permissions on all DB's as such . See below: my.cnf (my