The pit of the new server mysql installation

Install mysql 5.7

sudo apt-get install mysql-5.7-server

Configure my.cnf

View my.cnf configuration

locate my.cnf
mysql --help | grep 'my.cnf'

Generally speaking, it will show

                      order of preference, my.cnf, $MYSQL_TCP_PORT,
/etc/my.cnf /etc/mysql/my.cnf ~/.my.cnf

On ubuntu18.04, there is only /etc/mysql/my.cnf
open the my.cnf, will be guiding the
/etc/mysql/mysql.conf.d/mysqld.cnf

Modify bind-address

Normal operation

bind-address            = 0.0.0.0

pit:

The skip-grant-tables was added in the previous configuration, which caused the database to be stolen all the time. It is best not to add this

Create new user

mysql> create user admin identified by '123456';

Configure permissions

From the server can be used sudo mysqlto enter the mysql client then

mysql> grant all privileges on *.* to 'root'@'%' identified by '密码' with grant option;·

If no permission is granted, then remote login can only see the Information_schema database

Guess you like

Origin blog.csdn.net/weixin_44602409/article/details/107913787