• A+
所属分类:Linux
1. 下载rpm安装包
2.解压
tar -xvf mysql-8.0.12-1.el7.x86_64.rpm-bundle.tar
3.安装yum -y install net-tools* 库
安装libaio 库
4.删除原来所有的mysql依赖
yum remove mysql-libs
5. # rpm -ivh mysql-community-common-8.0.12-1.el7.x86_64.rpm
# rpm -ivh mysql-community-libs-8.0.12-1.el7.x86_64.rpm
# rpm -ivh mysql-community-client-8.0.12-1.el7.x86_64.rpm
# rpm -ivh mysql-community-server-8.0.12-1.el7.x86_64.rpm
6.启动并且验证是否启动
systemctl start mysqld
systemctl status mysqld
7.查找默认密码
grep 'temporary password' /var/log/mysqld.log
8.使用默认密码登陆后修改密码
alter user 'root'@'localhost' identified by 'pwd';
9.添加用户并且赋予远程访问权限
user mysql
create user 'laowang'@'localhost' identified by '123456'; //注意错误原因可能是密码复杂度
10.数据库授予用户权限
mysql> grant all privileges on news.* to 'news'@'39.15.16.14';

ruis

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: