LINUX.ORG.RU

История изменений

Исправление vvviperrr, (текущая версия) :

In MySQL, the localhost keyword is reserved for connection using the MySQL socket and you should use the ip-address 127.0.0.1 for TCP connections to the MySQL network port on 127.0.0.1. This means that both the server must grant privileges to users from specifically 127.0.0.1, and the client must use -h 127.0.0.1 to go through the tunnel instead of connecting to a local socket.

To allow you access using the SSH port forwarding you need something like:

GRANT SELECT ON *.* TO user@`127.0.0.1` and then run

FLUSH PRIVILEGES; and possibly

FLUSH QUERY CACHE; If it still doesn't work, restart the server process.

Исходная версия vvviperrr, :

In MySQL, the localhost keyword is reserved for connection using the MySQL socket and you should use the ip-address 127.0.0.1 for TCP connections to the MySQL network port on 127.0.0.1. This means that both the server must grant privileges to users from specifically 127.0.0.1, and the client must use -h 127.0.0.1 to go through the tunnel instead of connecting to a local socket.

To allow you access using the SSH port forwarding you need something like:

GRANT SELECT ON *.* TO user@`127.0.0.1`
and then run

FLUSH PRIVILEGES;
and possibly

FLUSH QUERY CACHE;
If it still doesn't work, restart the server process.