Home  >  Article  >  Backend Development  >  How to configure ubuntu's mysql to be accessible from the external network

How to configure ubuntu's mysql to be accessible from the external network

WBOY
WBOYOriginal
2016-08-04 09:21:131600browse

1. Use apt-get mysql-server mysql-client to install mysql and correctly configure the mysql user password. It can be accessed locally through phpmyadmin, but it cannot be accessed within the LAN. The modified mysql configuration file has only a few lines as follows
How to configure ubuntu's mysql to be accessible from the external network

Where is the real configuration file of mysql under ubuntu?

Reply content:

1. Use apt-get mysql-server mysql-client to install mysql and correctly configure the mysql user password. It can be accessed locally through phpmyadmin, but cannot be accessed within the LAN. The modified mysql configuration file has only a few lines as follows
How to configure ubuntu's mysql to be accessible from the external network

Where is the real configuration file of mysql under ubuntu?

The mysql configuration file installed by default is located in /etc/mysql/mysql.conf.d/, and the mysql installed by default can only be logged in on this machine with the root account

To achieve remote login to mysql, you need to authorize the account within mysql. Modifying the mysql configuration file cannot achieve this function.
The specific command is:
GRANT ALL PRIVILEGES ON . TO 'username'@'%' IDENTIFIED BY 'password'; Grant remote login permission

GRANT ALL PRIVILEGES ON database.* TO 'username'@'%' IDENTIFIED BY 'password'; Grant remote login to only access a certain database (database)

FLUSH PRIVILEGES; effective immediately

The found location is:/etc/mysql/mysql.conf.d/mysqld.cnf
The real configuration file is this

Modify the monitoring configuration. [mysqld]
bind-address = Set to the ip address to connect to. If you don’t know your IP, please comment it out

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn