腾讯云linux安装mysql8.0.17


wget https://mirrors.huaweicloud.com/mysql/Downloads/MySQL-8.0/mysql-community-common-8.0.17-1.el7.x86_64.rpm
wget https://mirrors.huaweicloud.com/mysql/Downloads/MySQL-8.0/mysql-community-libs-8.0.17-1.el7.x86_64.rpm
wget https://mirrors.huaweicloud.com/mysql/Downloads/MySQL-8.0/mysql-community-client-8.0.17-1.el7.x86_64.rpm
wget https://mirrors.huaweicloud.com/mysql/Downloads/MySQL-8.0/mysql-community-server-8.0.17-1.el7.x86_64.rpm
按common–>libs–>client–>server的顺序安装

rpm -ivh mysql-community-common*
yum remove mysql-libs(解决下一步执行的依赖mariadb-libs相关的错
rpm -ivh mysql-community-libs*
rpm -ivh mysql-community-client*
yum -y install numactl(解决下一步执行的依赖libnuma.so.1相关的错
rpm -ivh mysql-community-server*

启动mysq:systemctl start mysqld

生成随机密码:cat /var/log/mysqld.log | grep password

登录:mysql -u root -p  回车
输入密码:随机密码
修改密码:ALTER USER 'root'@'localhost' IDENTIFIED BY 'new@Pwd';

授权远程连接
use mysql 

select host, user, authentication_string, plugin from user; 

ALTER USER 'root'@'localhost' IDENTIFIED BY 'new@Pwd' PASSWORD EXPIRE NEVER;

将 MySQL 用户登录的加密规则修改为 mysql_native_password

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'new@Pwd';

FLUSH PRIVILEGES;

update user set host = "%" where user = "root";
FLUSH PRIVILEGES;

 

参考:https://blog.csdn.net/DynastyTing/article/details/84895107

https://blog.csdn.net/linkeliuyun/article/details/81950810?utm_source=blogxgwz3

https://cloud.tencent.com/developer/article/1532500


 

你可能感兴趣的:(mysql)