0

I have my MySQL instances set up as so:

[mysqld1]
port=3306
datadir=/some/dir
socket=/dome/dir/sock/mysqld.sock
user=mysql

[mysqld2]
port=3307
datadir=/some/dir2
socket=/dome/dir2/sock/mysqld.sock
user=mysql

I also logged into the server locally and added a user:

create user 'test'@'remote.server.addr' identified by 'pass';
grant all privileges on *.* for 'test'@'remote.server.addr' with grant option (syntax may be a little off)

I also confirmed these users were correctly created.

However, when I start the instances and try logging in, I get errors:

local> mysqld_multi start 1-2
remote> mysql -h dbserver.com -p 3006 -u test -p
ERROR 1130 (HY000): Host 'remote.server.addr' is not allowed to connect to this MySQL server

Same with port 3307. Have I missed a config step?

  • Check out the answer [here](http://stackoverflow.com/questions/32336722/cant-connect-to-mysqld-multi-instances-from-remote-server) and especially the comment from the MySQL FAQ. – uri2x Sep 01 '15 at 16:39
  • @uri2x - I think you put the wrong link :) It links back to here. – werhgvfwe5r Sep 01 '15 at 16:42
  • Sorry, [here](http://stackoverflow.com/questions/1559955) – uri2x Sep 01 '15 at 16:43
  • try -h 127.0.0.1 -p 3306 - it is possible that the bind address in the config is 127.0.0.1, then change it to 0.0.0.0 AND forget after GRANT - FLUSH PRIVILEGES; – Bernd Buffen Sep 01 '15 at 16:46
  • @BerndBuffen. Odd.... I can do `mysql -S /path/to/mysql.sock -u root -p` to login to the correct instance, but can't do `mysql -h 127.0.0.1 -p 3306 -u root -p`. I get `Access Denied for user 'root'@'localhost'`. How can it work locally with one command but not the other? – werhgvfwe5r Sep 01 '15 at 16:53
  • look for the TAG bind-address = in you /etc/my.cnf and edit it to 0.0.0.0 else the server not here on all ip. Also the grant is importent – Bernd Buffen Sep 01 '15 at 16:56

0 Answers0