A quick one today: While working on a project, I couldn’t access the MySQL server (version 5.7.12) that was on another system. I was in a development environment on a local network with just me on in, so the MySQL server did not have a firewall running. Here is what I did to get my connection to work.
- Add an Administrator user account with permissions to connect from any host:
CREATE USER 'edpflager'@'%' IDENTIFIED BY 'my_password';
GRANT ALL PRIVILEGES ON *.* TO 'edpflager'@'%'
WITH GRANT OPTION;
- Next open a terminal prompt on the MySQL server, and navigate to /etc/mysql/mysql.conf.d
- Open a text editor as superuser and edit mysqld.cnf
sudo nano ./mysqld.cnf
- Find the following line and add a # to the beginning to comment it out:
bind-address = 127.0.0.1
- Save, exit, and restart MySQL to make it take effect.
You should now be able to access MySQL as the admin account you created previously.