0

I have problems to connect to my MySQL-Server via remote-access.

I am using the MySQL Workbench. Everything is set up correctly (I mind). The MySQL Server is running on Ubuntu 16.04 with Plesk.

My user has all rights (including GRANT), the remote-restriction in the my.cnf is commented out:

# bind-address = ::ffff:127.0.0.1

Database-Name is "localhost" and I try to connect via the IP-address of my server.

Important to say is, that there's no user-error (e.g. wrong password or missing permission). So I think, it's an Firewall-problem.

1

1 Answer 1

2

1. Change mysql config

Find the mysql config file

/etc/mysql/my.cnf

OR (if above file points to !includedir /etc/mysql/mysql.conf.d/)

/etc/mysql/mysql.conf.d/mysqld.cnf

Comment out following lines (IF ANY)

#bind-address = 127.0.0.1

This allows outside connections other than localhost (127.0.0.1)

#skip-networking

This allow listening of TCP/IP ports

2. Change GRANT privilege

mysql> GRANT ALL PRIVILEGES ON *.* TO 'USERNAME'@'%' 
IDENTIFIED BY 'PASSWORD' WITH GRANT OPTION;

Following ensures that user has access to all schemas in the database

*.*

% ensures that user can connect from any IP address / Network

'USERNAME'@'%'

Then run this command to apply the changes.

mysql> FLUSH PRIVILEGES;

3. Restart MySQL server

Restart the server

service mysql restart

4. Connect to server

Default port for MySQL is

3306

You can also find the port that it's running using this command

netstat -tln

It should return something like this

tcp        0      0 127.0.0.1:3306              0.0.0.0:*                   LISTEN 

In MySQL Workbench

Use the SQL Server's IP address as Host name

Use 3306 as Port Number

Use the User that you granted access to

Use 'password' that you used in the GRANT command

Please refer to https://easyengine.io/tutorials/mysql/remote-access/

Sign up to request clarification or add additional context in comments.

1 Comment

My scenario: Ubuntu 16.04 with Plesk, 1st step was working for me. Thanks!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.