zl程序教程

您现在的位置是:首页 >  系统

当前栏目

腾讯云 centos 7.6 rpm 安装mysql8.0

centos安装腾讯 RPM MySQL8.0 7.6
2023-09-11 14:13:57 时间

centos 7.6 rpm 安装mysql8.0

1.检查:
rpm -qa|grep mysql //检查是否安装了mysql
rpm -qa|grep mariadb //检查是否安装了mariadb
yum install wget
2.进行远程仓库的创建:
wget https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm
rpm -ivh mysql80-community-release-el7-3.noarch.rpm

安装:
1.安装命令:
进入/etc/yum.repos.d/目录后在执行一下脚本:
安装: [root@VM-0-13-centos yum.repos.d]#
yum install mysql-server
启动:systemctl start mysqld
检查是否启动成功:systemctl status mysqld
2.首次登录,:
获取安装的临时密码: grep 'temporary password' /var/log/mysqld.log

登录:mysql -uroot -p 输入获取的临时密码

修改本地用户密码:
alter user 'root'@'localhost' identified by 'Ss@123123' //大小写字母,特殊字符,数字

3.创建远程访问用户: create user 'root'@'%' identified by 'Sa@123123'
授权远程访问用户:grant all on *.* to 'root'@'%';
刷新:flush privileges;