Can't access remotely after mysql is installed on debian

create user

CREATE USER username IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON *.* TO 'username'@'%'IDENTIFIED BY 'password' WITH GRANT OPTION;

Notes:

File path /etc/mysql/mariadb.conf.d/50-server.cnf
bind-address = 127.0.0.1 ###This sentence means that only the local machine is allowed to access mysql

become like this

#bind-address=127.0.0.1
restart mysql: /etc/init.d/mysql restart

The remote link is successful, the firewall must open port 3306

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325061317&siteId=291194637