直接按步骤安装
# wget # rpm -ivh mysql-community-release-el6-5.noarch.rpm[root@localhost ~]# yum repolist all | grep mysql 查看一下是否已经有mysql可安装文件mysql-connectors-community MySQL Connectors Community enabled: 36mysql-connectors-community-source MySQL Connectors Community - So disabledmysql-tools-community MySQL Tools Community enabled: 47mysql-tools-community-source MySQL Tools Community - Source disabledmysql55-community MySQL 5.5 Community Server disabledmysql55-community-source MySQL 5.5 Community Server - So disabledmysql56-community MySQL 5.6 Community Server enabled: 358mysql56-community-source MySQL 5.6 Community Server - So disabledmysql57-community-dmr MySQL 5.7 Community Server Deve disabledmysql57-community-dmr-source MySQL 5.7 Community Server Deve disabled
yum 安装即可
[root@localhost ~]# yum install mysql-community-server -y安装成功后# service mysqld start设置root密码# mysql -u root# use mysql;# update user set password=PASSWORD("这里输入root用户密码") where User='root';# flush privileges; mysql安全设置# mysql_secure_installation设置开启自启动命令# chkconfig mysqld on