提示:都一一经过测试
一? 最新yum源一键安装
官方yum源地址
MySQL :: Download MySQL Yum Repository
https://dev.mysql.com/get/mysql80-community-release-el7-4.noarch.rpm
地址失效的话按下列操作
进入官网点击 Down
复制链接地址后进行下列操作
安装mysql-yum源
yum localinstall https://dev.mysql.com/get/mysql80-community-release-el7-4.noarch.rpm
安装mysql
yum install mysql-community-server
#启动mysql
systemctl start mysqld
#查看mysql状态
systemctl status mysqld
#查看mysql初始密码
cat /var/log/mysqld.log | grep password
连接mysql
mysql -u root -p
输入密码
修改密码
alter user user() identified by "123456";
注意:yum最新版本会限制密码输入条件
?
?二? yum源安装指定版本
?
?
?这里复制这里的地址
创建目录
cd /usr/local
mkdir mysql
通过wget下载
wget https://downloads.mysql.com/archives/get/p/23/file/mysql-8.0.18-1.el7.x86_64.rpm-bundle.tar
没有wget的话通过下列安装
yum install wget -y
然后解压
tar -xvf mysql-8.0.18-1.el7.x86_64.rpm-bundle.tar
ll命令查看
然后一一解压下列语句
rpm -ivh mysql-community-common-8.0.18-1.el7.x86_64.rpm
rpm -ivh mysql-community-libs-8.0.18-1.el7.x86_64.rpm
rpm -ivh mysql-community-client-8.0.18-1.el7.x86_64.rpm
rpm -ivh mysql-community-server-8.0.18-1.el7.x86_64.rpm
?可能出现问题情况:
查看?
rpm -qa | grep mariadb
?删除mariadb
rpm -e mariadb-libs-5.5.60-1.el7_5.x86_64 --nodeps
ok,重试
?下载依赖
yum install net-tools -y
yum install perl-Module-Install.noarch?-y
ok,重试
初始化
mysqld --initialize
授权
chown mysql:mysql /var/lib/mysql -R
启动mysql
systemctl start mysqld
查看mysql状态
systemctl status mysqld
连接mysql
mysql -u root -p
修改密码
alter user user() identified by "123456";
?有关mysql权限问题跳转这里mysql用户权限_挽風入耳的博客-CSDN博客
|