首页 > 代码库 > centos5.11 repo 安装mysql5.7

centos5.11 repo 安装mysql5.7

http://dev.mysql.com/doc/refman/5.7/en/linux-installation-yum-repo.html

mysql yum repo 安装说明

http://dev.mysql.com/downloads/repo/yum/

下载对应的版本el5版本的

执行对应版本的命令,我的是centos5.11

sudo rpm -Uvh mysql57-community-release-el5-7.noarch.rpm

若显示失败,执行

rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

在执行

sudo rpm -Uvh mysql57-community-release-el5-7.noarch.rpm

成功以后,开始安装

sudo yum install mysql-community-server

启动mysql,service mysqld start

显示失败

ERROR 2002 (HY000): Can‘t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock‘ (2)

执行mysql初始化

/usr/sbin/mysqld --initialize --user=mysql --datadir=/var/lib/mysql

service mysqld start 成功!

查找mysql 初始密码

grep "password" /var/log/mysqld.log

修改mysql5.7初始密码

详见 http://www.cnblogs.com/kxxx/p/5916863.html

vim /etc/my.conf

添加skip-grant-tables=1

重启mysql服务

进入mysql

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

重启服务

centos5.11 repo 安装mysql5.7