External access to MySQL database
To gain external access to MySQL database (f.e. in PHPSTorm or an external PHPMyAdmin) you can do: GRANT necessary privileges:
1 2 3 |
CREATE USER 'wdn_live_user'@'%' IDENTIFIED BY '***'; GRANT USAGE ON *.* TO 'wdn_live_user'@'%' IDENTIFIED BY '***' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0; GRANT ALL PRIVILEGES ON `wdn_live`.* TO 'wdn_live_user'@'%'; |
If the user already exists, you can leave the first line. Allow access from outside localhost:
1 2 |
$> sudo sed -i "s/^bind-address/#bind-address/" /etc/mysql/my.cnf $> sudo service mysql restart |
On CentOS the my.cnf usually is directly located in /etc/ and the service name is mysqld. Check […]