Localhost connection is enabled in MySQL.
But Remote(My laptop) access is disabled
Can't connect to MySQL server on "host" (10061)`.
My port always open 3306.
Here is my config file (/etc/mysql/my.cnf
) :
#bind-address 0.0.0.0
!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mysql.conf.d/
And MySQL status is :
mysql start/running, process 15204
The error 10060 is returned by the MySQL client when a connection could not be established with the service on the system you are connecting to. This is commonly caused by a firewall block or network issue preventing the connection.
To allow remote access to MySQL, you have to comment out bind-address (you did) and skip-networking in the configuration file.
Next, you have to make sure the user is allowed remote access. Check your user with this:
SELECT User, Host FROM mysql.user;
If your user here has '127.0.0.1' or 'localhost' listed as host, you don't have remote access.
Change this with:
UPDATE mysql.user SET HOST='%' WHERE User='__here_your_username';
Flush privileges:
FLUSH PRIVILEGES;
The '%' is a wildcard for 'all hosts'.
To Allow remote access to MySQL installed on a Ubuntu, you will have to access the file at this location:
/etc/mysql/mysql.conf.d/mysqld.cnf
There, you comment out the following line: bind-address = 127.0.0.1
basically to change: bind-address = 127.0.0.1 to: #bind-address = 127.0.0.1
Now you either restart the computer or just the mySQL service using the follwing command: sudo /etc/init.d/mysql restart
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With