How to make mysql accept external connections

I have a VPS and I want to force mysql DB to accept the connection from the outside (for example, from my PC). I have Debian Linux installed on the server. I checked several tutorials online and they said to comment:

bind-address          = 127.0.0.1

But it did not help! Is there anything specific for VPS? or did i miss something else? The command that starts mysql:

/usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysqld/mysqld.pid --skip-external-locking --port=3306 --socket=/var/run/mysqld/mysqld.sock
+3
source share
3 answers

MySQL ( ) (TCP- 3306). MySQL (. iptables, * nix).

MySQL .

MySQL @localhost. , , IP-, . , :

GRANT ALL PRIVILEGES ON somedatabase.* TO someuser@'somehostname' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;

, , - ( PHP):

mysql_connect('mysqlservername', 'someuser', 'password');
+4

ip VPS (ipconfig ).

. localhost root :

grant all privilege on *.* to `username`@`your-pc-id` identified by 'your-password'

MySQL.

+1

IP- IP- localhost. MySQL.

.

0

Source: https://habr.com/ru/post/1709574/


All Articles