To open MySQL for anything other than local, you need the following line
For mysql version 5.6 and below
without commenting in /etc/mysql/my.cnf and assigned to your computers an IP address, not a loopback
For mysql version 5.7 and higher
without commenting in /etc/mysql/mysql.conf.d/mysqld.cnf and assigned to your computers an IP address, not a loopback
Or add bind-address = 0.0.0.0 if you do not want to specify IP
Then stop and restart MySQL with the new entry my.cnf. After starting, go to the terminal and enter the following command.
lsof -i -P | grep :3306
Something like this with your actual xxx's IP address
mysqld 1046 mysql 10u IPv4 5203 0t0 TCP xxx.xxx.xxx.xxx:3306 (LISTEN)
If the above operator returns correctly, you can accept remote users. However, for a remote user to connect with the correct privileges, you need this user to create both a local host and "%", as in.
CREATE USER 'myuser'@'localhost' IDENTIFIED BY 'mypass'; CREATE USER 'myuser'@'%' IDENTIFIED BY 'mypass';
then
GRANT ALL ON *.* TO 'myuser'@'localhost'; GRANT ALL ON *.* TO 'myuser'@'%';
and finally
FLUSH PRIVILEGES; EXIT;
If you do not have the same user that was created as described above, when you log in locally, you can inherit the basic privileges of localhost and have access problems. If you want to restrict myuser access, then you will need to read the syntax of the GRANT statement HERE. If you go through all this and still have problems, add an additional output error and the corresponding my.cnf lines.
NOTE. If lsof is not returned or not found, you can install it HERE based on your Linux distribution. You do not need lsof to make everything work, but it is very convenient when everything does not work as expected.