关于我们

质量为本、客户为根、勇于拼搏、务实创新

< 返回新闻公共列表

centos单独安装mysql5.5数据库和安装报错处理过程分享!

发布时间:2022/11/7 13:53:19
香港云服务器

安装过程遇到不少问题, 最终解决,下面分享下,希望对各位朋友有一定帮助。

一、下载mysql服务端、客户端、库和包含文件、模块

wget -c http://dev.mysql.com/get/Downloads/MySQL-5.5/MySQL-server-5.5.30-1.el6.x86_64.rpm/from/http://mysql.spd.co.il/
wget -c http://dev.mysql.com/get/Downloads/MySQL-5.5/MySQL-client-5.5.30-1.el6.x86_64.rpm/from/http://mysql.spd.co.il/
wget -c http://dev.mysql.com/get/Downloads/MySQL-5.5/MySQL-devel-5.5.30-1.el6.x86_64.rpm/from/http://mysql.spd.co.il/

二、安装mysql服务端、客户端、库和包含文件、模块

rpm -ivh MySQL-server-5.5.30-1.el6.x86_64.rpm --nodeps --force 
rpm -ivh MySQL-client-5.5.30-1.el6.x86_64.rpm --nodeps --force 
rpm -ivh MySQL-devel-5.5.30-1.el6.x86_64.rpm --nodeps --force

安装好mysql发现无法启动查看日志,提示:加载共享库时出错xxxxxxxxxxxx 缺少libaio 错误如下:

[root@MyCloudServer ~]# service mysql startStarting MySQL. ERROR! The server quit without updating PID file (/var/lib/mysql/MyCloudServer.pid).[root@MyCloudServer ~]# cat /var/log/mysqld.log 150703 13:45:11 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql/usr/sbin/mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory150703 13:45:11 mysqld_safe mysqld from pid file /var/lib/mysql/MyCloudServer.pid ended

三、安装libaio

yum install libaio

安装好后还是提示错误,错误如下:

InnoDB: Foreign key constraint system tables created
150703 13:48:26 InnoDB: Waiting for the background threads to start
150703 13:48:27 InnoDB: 5.5.30 started; log sequence number 0
150703 13:48:27 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
150703 13:48:27 [Note] - '0.0.0.0' resolves to '0.0.0.0';
150703 13:48:27 [Note] Server socket created on IP: '0.0.0.0'.
150703 13:48:27 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist
150703 13:48:27 mysqld_safe mysqld from pid file /var/lib/mysql/MyCloudServer.pid ended

四、初始化数据库

mysql_install_db

五、修改mysql数据库密码,默认空密码 直接输入mysql回车登录。

mysql>use mysql;
mysql> update user set password=passworD("test") where user='root';
mysql> flush privileges;
mysql> exit;
卸载请执行:rpm -qa | grep -i mysql  查看已安装的包 再执行rpm -e MySQL-xxxxxxxxxxxxx

本次测试系统为centos6.4 64位 成功安装mysql5.5数据库,上为本人安装过程。