linux安装mysql8
- mysql官网下载链接:mysql repo下载地址 如下:https://dev.mysql.com/downloads/repo/yum/
wget https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm
rpm -ivh mysql80-community-release-el7-3.noarch.rpm
然后
yum install mysql-community-server
开启服务器
systemctl start mysqld.service
获取临时密码
cat /var/log/mysqld.log | grep password
登录mysql
mysql -u root -p
修改密码
ALTER USER 'root'@'localhost' IDENTIFIED BY '新密码';
flush privileges;
远程设置
update user set host='%' where user='root';
flush privileges;
ALTER USER 'root'@'%' IDENTIFIED BY 'password' PASSWORD EXPIRE NEVER;
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'password';