Virtual machine installation Mysql

1. Download Mysql package, here I use the mysql-5.7.25-linux-glibc2.12-x86_64.tar.gz;

2. Use a script to create Mysql, with specific reference to https://blog.csdn.net/zfyy1989/article/details/88873438

Problems encountered:

1) reset the root password

1.1, vi /etc/my.cnf
add parameters to skip-grant-tables to save and exit [mysqld] Under;

1.2 mysql command line and no password to enter the password:

update user set authentication_string=password('root') where user='root';

1.3 The parameter commented out and restart the service:

 

2) Mysql default can not remotely connect, you need to modify:

2.1 update user set host = ’%’ where user = ’root’;

 

3) navicat remote connections newspaper Can not connect to MySQL server on '' (10038)

We need to modify the firewall:

Reload
firewall-cmd --reload
view
firewall-cmd --zone = public --query- port = 3306 / tcp
delete
firewall-cmd --zone = public --remove- port = 3306 / tcp --permanent

firewall-cmd --zone = public --add-port = 3306 / tcp --permanent (--permanent permanent, this parameter is not restarted after the failure)

firewall-cmd --zone=public --add-port=1000-2000/tcp --permanent
 

Published 25 original articles · won praise 1 · views 10000 +

Guess you like

Origin blog.csdn.net/kimi_Christmas/article/details/100568935