yum安装高版本mysql(5.5)
1、导入第三方源webtatic
rpm -Uvh http://repo.webtatic.com/yum/centos/5/latest.rpm
2、如果已安装低版本的mysql就删除
yum remove mysql mysql-*
3、安装libmysqlclient15
yum install libmysqlclient15 --enablerepo=webtatic
4、安装mysql5.5
yum install mysql55 mysql55-server --enablerepo=webtatic
5、启动并升级mysql
service mysqld start
mysql_upgrade
启动mysql时出现如下问题:
140524 03:15:57 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql 140524 3:15:57 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it. 140524 3:15:57 InnoDB: Initializing buffer pool, size = 8.0M 140524 3:15:57 InnoDB: Completed initialization of buffer pool 140524 3:15:57 InnoDB: Started; log sequence number 0 44233 140524 3:15:57 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist 140524 03:15:57 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
使用:mysql_install_db --user=mysql --ldata=/var/lib/mysql/
报:110806 00:32:20 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql5.5/data
^G/usr/local/mysql5.5/bin/mysqld: File './mysql-bin.index' not found (Errcode: 13)
因为没有/var/lib/mysql下没有权限
授权chmod 777 /var/lib/mysql/*
再运行mysql_install_db --user=mysql --ldata=/var/lib/mysql/ 就成功了
直接启动mysql 就ok了