当前位置:网站首页>Mysql5.7 setup password and remote connection

Mysql5.7 setup password and remote connection

2022-06-21 14:32:00 Internet Walker

download yum repo https://dev.mysql.com/downloads/repo/yum/

After downloading, the default is 8.0, Switch to 5.7

shell> yum repolist all | grep mysql

shell> sudo yum-config-manager --disable mysql80-community

shell> sudo yum-config-manager --enable mysql57-community

If the order doesn't exist , install yum-utils

yum install mysql-community-server

After installation, set the basic configuration in vim /etc/my.cnf

start-up mysql service systemctl start mysqld

You can use the command to initialize after startup grep 'temporary password' /var/log/mysqld.log obtain

Change initialization password ( The initialization password must be changed ) , First, you need to lower the password policy

set global validate_password_policy=0;
set global validate_password_length=6;

Then you can change the password alter user [email protected] identified by '123456'

Remote connection

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456';

flush privileges;

 

原网站

版权声明
本文为[Internet Walker]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202221423319510.html