1) Check if remote access is allowed for user:
SELECT User, Host FROM mysql.user;
if user has %
(wildcard just as * ) in host then this user can establish connection from anywhere, you can update this wildcard or specific ip as
UPDATE mysql.user SET HOST='%' WHERE User='<your_username>';
and then flush privileges with:
FLUSH PRIVILEGES;
2) If MySQL is installed on a Ubuntu, you will have to access the file at this location: cd /etc/mysql/mysql.conf.d/mysqld.cnf
Open the file and comment the binded-address i.e.
change: bind-address = 127.0.0.1 to: #bind-address = 127.0.0.1
to bring changes on effect restart the mysql or reboot the system itself:
i.e. restart:
sudo service mysql restart
3) Access from cli:
mysql -u <user_name> -h <host or ip addrsss> -p
Top comments (0)