centos7安装mysql8
程序员文章站
2022-03-12 07:58:15
...
下载https://cdn.mysql.com//Downloads/MySQL-8.0/mysql-8.0.18-1.el7.x86_64.rpm-bundle.tar后上传解压
yum install -y numactl-libs
yum remove -y mariadb-libs
tar -xvf mysql-8.0.18-1.el7.x86_64.rpm-bundle.tar
rpm -i mysql-community-common-8.0.18-1.el7.x86_64.rpm
rpm -i mysql-community-libs-8.0.18-1.el7.x86_64.rpm
rpm -i mysql-community-client-8.0.18-1.el7.x86_64.rpm
rpm -i mysql-community-server-8.0.18-1.el7.x86_64.rpm
//启动
systemctl start mysqld.service
//设置开机启动
systemctl enable mysqld.service
//查看自动生成的root密码 登录
cat /var/log/mysqld.log | grep password
mysql -uroot -p
//先修改root本地登录密码 如果修改不成功就证明密码太简单
alter user 'root'@'localhost' identified by '[email protected]#123qweQWE';
//创建远程登录用户 并设置密码加密方式
create user 'hefei'@'%' identified with mysql_native_password by '[email protected]#123qweQWE';
grant all privileges on *.* to [email protected]'%';
flush privileges;