系统centos5.5

进入http://dev.mysql.com/downloads/repo/,下载RedHat Enterprise Linux 5 / Oracle Linux 5版。

点击链接No thanks, just start my download.直接下载。

导入系统:sudo yum localinstall mysql-community-release-el5-*.noarch.rpm  

您可能遇到这个问题:

warning: rpmts_HdrFromFdno: V3 DSA signature: NOKEY, key ID 443e1821
Public key for krb5-workstation-1.3.4-27.i386.rpm is not installed

解决方法:

/etc/yum.conf   Were it sais gpgcheck=1, change this to gpgcheck=0.

 groupadd mysql           # 创建msyql组
 useradd -g mysql mysql

参考资料:https://www.digitalocean.com/community/tutorials/how-to-install-mysql-5-6-from-official-yum-repositories

安装完毕后

service mysqld start报错

/usr/sbin/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13 - Permission denied),提示没有目录权限

更改datadir目录权限:chown -R mysql:mysql /var/lib/mysql

start继续报错

/usr/sbin/mysqld: Table 'mysql.plugin' doesn't exist

去datadir目录,表确实不存在

执行建表:/usr/bin/mysql_install_db --user=mysql

再次启动,成功