Mysql yum安装排错

嚯嚯嚯www 32 2022-08-26

Step1: 检测系统是否自带安装mysql

# yum list installed | grep mysql

Step2: 删除系统自带的mysql及其依赖
命令:

# yum -y remove mysql-libs.x86_64

Step3: 给CentOS添加rpm源,并且选择较新的源
命令:

# wget dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm
# yum localinstall mysql-community-release-el6-5.noarch.rpm
# yum repolist all | grep mysql
# yum-config-manager --disable mysql55-community
# yum-config-manager --disable mysql56-community
# yum-config-manager --enable mysql57-community-dmr
# yum repolist enabled | grep mysql

Step4:安装mysql 服务器
命令:

# yum install mysql-community-server

Step5: 启动mysql
命令:

# service mysqld start

问题:
82397-69z5sqk3dxv.png
请一次日志,再次启动
79076-03r6u2kw3ldx.png
查看日志
11587-jw5us7mlfr.png
日志提示内存出故障,查看内存
62210-ky78fy5wkc.png
Swap为0,添加128M
13940-4f03mx0f6of.png
67518-jzuo9yhcop.png

Root密码修改问题
在之前的版本中,密码字段的字段名是 password,5.7版本改为了 authentication_string
命令:

update user set authentication_string = password('password'), password_expired = 'N', password_last_changed = now() where user = 'root';