【安装步骤】
- contos7默认安装了mariadb数据库,这里把他移除:yum remove mariadb-libs.x86_64
- 创建文件目录 mkdir /etc/mysql
- cd /etc/mysql
- 下载
wget https://dev.mysql.com/get/mysql80-community-release-el7-1.noarch.rpm
- 下载添加到本地
yum localinstall mysql80-community-release-el7-1.noarch.rpm
- 安装
yum install mysql-community-server
- 启动
service mysqld start service mysqld status
- 进入mysql
查找密码cat /var/log/mysqld.log | grep password
mysql -u root -p
然后输入密码进入
修改密码(最好符号字母数字都有)
alter user 'root'@'localhost' identified by '!!Admin123';
然后刷新权限
flush privileges ;
转载于:https://www.jianshu.com/p/94f11628cc15