64位linux下rpm安装mysql的5.5.55版本
昨天同事开了个阿里云环境,让我帮他安装mysql数据库,本想着很简单的一件事,结果还是折腾了一番。坑很多,一路趟过,一个接一个,只能硬着头皮冲。
首先是下载压缩包,因为采用了rpm安装方式,所以下载的是rpm包。rpm需要至少3个包,一个客户端,一个服务端,还有一个开发包,这3个是必须的。另外还有好几个相关的包,我一并都下了,附上下载地址:
https://centos.pkgs.org/5/atomic-x86_64/mysql-5.5.55-1659.el5.art.x86_64.rpm.html
https://centos.pkgs.org/5/atomic-x86_64/mysql-server-5.5.55-1659.el5.art.x86_64.rpm.html
https://centos.pkgs.org/5/atomic-x86_64/mysql-devel-5.5.55-1659.el5.art.x86_64.rpm.html
https://centos.pkgs.org/5/atomic-x86_64/mysql-libs-5.5.55-1659.el5.art.x86_64.rpm.html
https://centos.pkgs.org/5/atomic-x86_64/mysql-embedded-5.5.55-1659.el5.art.x86_64.rpm.html
https://centos.pkgs.org/5/atomic-x86_64/mysql-embedded-devel-5.5.55-1659.el5.art.x86_64.rpm.html
https://centos.pkgs.org/5/atomic-x86_64/mysql-test-5.5.55-1659.el5.art.x86_64.rpm.html
第一步就进坑,这第一个坑引起了后面所有的坑。这里下载版本是比较老的,而且是从centos.pkgs.org上下载的,而不是从mysql官网。虽然包是没啥区别,但这里同一版本号的包竟然不放在一起,而是按客户端、服务端这样去分类的。这让我在后面碰到各种奇葩问题的时候,一度怀疑自己是不是下对了包、漏下了包,所以才把所有5.5.55相关的包都下了。不怕一万,就怕万一啊。建议还从mysql官网下包,官网会弹出一个下拉框给你选版本,清晰明了。这里介绍怎么从官网安装Windows版的mysql:64位windows下mysql安装。
另一个问题就是这里下的包对应的是centos操作系统,而且版本号是5。下包前要确认自己linux的操作系统,可以在linux用该命令看
[root@izwz932ypmamm80m434qqyz lib]# cat /proc/version
Linux version 3.10.-514.26..el7.x86_64 (builder@kbuilder.dev.centos.org) (gcc version 4.8. (Red Hat 4.8.-) (GCC) ) # SMP Tue Jul :: UTC
centOS也算是RedHat,所以下一步就是安装了,把上面的rpm包都通过ftp上传到usr下新建的mysql目录里,重复执行解压命令,开始报错了:
[root@izwz932ypmamm80m434qqyz mysql]# rmp -ivh mysql-server-5.5.-.el5.art.x86_64.rpm
-bash: rmp: command not found
[root@izwz932ypmamm80m434qqyz mysql]# rpm -ivh mysql-server-5.5.-.el5.art.x86_64.rpm
warning: mysql-server-5.5.-.el5.art.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID 4520afa9: NOKEY
error: Failed dependencies:
libcrypto.so.()(64bit) is needed by mysql-server-5.5.-.el5.art.x86_64
libssl.so.()(64bit) is needed by mysql-server-5.5.-.el5.art.x86_64
perl(DBI) is needed by mysql-server-5.5.-.el5.art.x86_64
perl(Data::Dumper) is needed by mysql-server-5.5.-.el5.art.x86_64
perl-DBD-MySQL is needed by mysql-server-5.5.-.el5.art.x86_64
perl-DBI is needed by mysql-server-5.5.-.el5.art.x86_64
这个错误是依赖分析失败引起的,可以通过增加命令参数忽略依赖分析,直接执行解压:
[root@izwz932ypmamm80m434qqyz mysql]# rpm -ivh mysql-server-5.5.-.el5.art.x86_64.rpm --nodeps --force
解压结束后按道理mysql已经装好了,此时在/usr/share/mysql目录下会给出几个示例配置文件,这里选择my-medium.cnf,把它复制到下/etc/my.cnf作为启动配置文件,执行/usr/bin目录里的mysql_install_db脚本就初始化启动数据库,继续报错:
[root@izwz932ypmamm80m434qqyz ~]# cp /usr/share/mysql/my-medium.cnf /etc/my.cnf
cp: overwrite ‘/etc/my.cnf’? y
[root@izwz932ypmamm80m434qqyz ~]# /usr/bin/mysql_install_db
Installing MySQL system tables...
/usr/libexec/mysqld: error while loading shared libraries: libaio.so.: cannot open shared object file: No such file or directory Installation of system tables failed! Examine the logs in
/var/lib/mysql for more information. You can try to start the mysqld daemon with: shell> /usr/libexec/mysqld --skip-grant & and use the command line tool /usr/bin/mysql
to connect to the mysql database and look at the grant tables: shell> /usr/bin/mysql -u root mysql
mysql> show tables Try 'mysqld --help' if you have problems with paths. Using --log
gives you a log in /var/lib/mysql that may be helpful. Please consult the MySQL manual section
'Problems running mysql_install_db', and the manual section that
describes problems on your OS. Another information source are the
MySQL email archives available at http://lists.mysql.com/. Please check all of the above before submitting a bug report
at http://bugs.mysql.com/
这里提示找不到libaio.so.1,好吧,那么就下载对应的包吧。既然已经上了centos.pkgs.org的贼船,只好一路走到黑了。还是找了centOS5的rpm包:
https://centos.pkgs.org/5/centos-x86_64/libaio-0.3.106-5.x86_64.rpm.html
执行安装命令rpm -ivh(这次无需加参数--nodeps --force了)后,发现libaio.so.1已经出现在/usr/lib64目录下了,只不过发现其实该文件也就是个软链接而已:
[root@izwz932ypmamm80m434qqyz mysql]# cd /usr/lib64
[root@izwz932ypmamm80m434qqyz lib64]# ll
total
drwxr-xr-x. root root Aug : alsa-lib
drwxr-xr-x. root root Aug : audit
lrwxrwxrwx. root root Aug : cracklib_dict.hwm -> ../../usr/share/cracklib/pw_dict.hwm
lrwxrwxrwx. root root Aug : cracklib_dict.pwd -> ../../usr/share/cracklib/pw_dict.pwd
lrwxrwxrwx. root root Aug : cracklib_dict.pwi -> ../../usr/share/cracklib/pw_dict.pwi
-rw-r--r-- root root Jul : crt1.o
-rw-r--r-- root root Jul : crti.o
-rw-r--r-- root root Jul : crtn.o
drwxr-xr-x. root root Aug : dbus-
drwxr-xr-x. root root Aug : ebtables
drwxr-xr-x. root root Aug : elfutils
drwxr-xr-x. root root Aug : fipscheck
dr-xr-xr-x. root root Nov games
drwxr-xr-x. root root Aug : gconv
-rw-r--r-- root root Jul : gcrt1.o
drwxr-xr-x. root root Aug : gettext
drwxr-xr-x. root root Aug : gio
drwxr-xr-x. root root Aug : girepository-1.0
drwxr-xr-x. root root Dec krb5
-rwxr-xr-x root root Jul : ld-2.17.so
lrwxrwxrwx root root Aug : ld-linux-x86-.so. -> ld-2.17.so
lrwxrwxrwx root root Aug : ld-lsb-x86-.so. -> ld-linux-x86-.so.
lrwxrwxrwx. root root Aug : libacl.so. -> libacl.so.1.1.
-rwxr-xr-x. root root Jun libacl.so.1.1.
lrwxrwxrwx root root Dec : libaio.so.1 -> libaio.so.1.0.
重新执行/usr/bin/mysql_install_db,又报错了,这次是找不到libcrypto.so.6文件,我先退出到根目录搜了一下
find -name 'libcrypto.so.6'
发现该文件是存在的,只不过是在/usr/local/aegis/PythonLoader/third_party目录下。直接建立软链接
cd usr/lib64
ln -s /usr/local/aegis/PythonLoader/third_party/libcrypto.so. libcrypto.so.
其他找不到文件的情况处理方式同上。现在文件都有了,初始化数据库终于成功了:
[root@izwz932ypmamm80m434qqyz lib64]# /usr/bin/mysql_install_db
Installing MySQL system tables...
:: [Note] Ignoring --secure-file-priv value as server is running with --bootstrap.
:: [Note] /usr/libexec/mysqld (mysqld 5.5.-log) starting as process ...
OK
Filling help tables...
:: [Note] Ignoring --secure-file-priv value as server is running with --bootstrap.
:: [Note] /usr/libexec/mysqld (mysqld 5.5.-log) starting as process ...
OK To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands: /usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h izwz932ypmamm80m434qqyz password 'new-password' Alternatively you can run:
/usr/bin/mysql_secure_installation which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers. See the manual for more instructions. You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe & You can test the MySQL daemon with mysql-test-run.pl
cd /usr/mysql-test ; perl mysql-test-run.pl Please report any problems at http://bugs.mysql.com/
好了,既然数据库已经初始化了,改启动mysql了,问题来了:
[root@izwz932ypmamm80m434qqyz /]# service mysqld start
Starting mysqld (via systemctl): Job for mysqld.service failed because the control process exited with error code. See "systemctl status mysqld.service" and "journalctl -xe" for details. [root@izwz932ypmamm80m434qqyz /]# systemctl status mysqld.service
● mysqld.service - LSB: start and stop MySQL server
Loaded: loaded (/etc/rc.d/init.d/mysqld; bad; vendor preset: disabled)
Active: failed (Result: exit-code) since Tue -- :: CST; 54s ago
Docs: man:systemd-sysv-generator()
Process: ExecStart=/etc/rc.d/init.d/mysqld start (code=exited, status=/FAILURE) Dec :: izwz932ypmamm80m434qqyz mysqld[]: You can test the MySQL...
Dec :: izwz932ypmamm80m434qqyz mysqld[]: cd /usr/mysql-test ; p...
Dec :: izwz932ypmamm80m434qqyz mysqld[]: Please report any prob...
Dec :: izwz932ypmamm80m434qqyz mysqld[]: [ OK ]
Dec :: izwz932ypmamm80m434qqyz mysqld[]: MySQL Daemon failed to...
Dec :: izwz932ypmamm80m434qqyz mysqld[]: Starting mysqld: [FAI...
Dec :: izwz932ypmamm80m434qqyz systemd[]: mysqld.service: control p...
Dec :: izwz932ypmamm80m434qqyz systemd[]: Failed to start LSB: star...
Dec :: izwz932ypmamm80m434qqyz systemd[]: Unit mysqld.service enter...
Dec :: izwz932ypmamm80m434qqyz systemd[]: mysqld.service failed.
Hint: Some lines were ellipsized, use -l to show in full. [root@izwz932ypmamm80m434qqyz /]# journalctl -xe
Dec :: izwz932ypmamm80m434qqyz mysqld[]: /usr/bin/mysqladmin -u root password 'new-password'
Dec :: izwz932ypmamm80m434qqyz mysqld[]: /usr/bin/mysqladmin -u root -h izwz932ypmamm80m434qqyz password 'new-password'
Dec :: izwz932ypmamm80m434qqyz mysqld[]: Alternatively you can run:
Dec :: izwz932ypmamm80m434qqyz mysqld[]: /usr/bin/mysql_secure_installation
Dec :: izwz932ypmamm80m434qqyz mysqld[]: which will also give you the option of removing the test
Dec :: izwz932ypmamm80m434qqyz mysqld[]: databases and anonymous user created by default. This is
Dec :: izwz932ypmamm80m434qqyz mysqld[]: strongly recommended for production servers.
Dec :: izwz932ypmamm80m434qqyz mysqld[]: See the manual for more instructions.
Dec :: izwz932ypmamm80m434qqyz mysqld[]: You can start the MySQL daemon with:
Dec :: izwz932ypmamm80m434qqyz mysqld[]: cd /usr ; /usr/bin/mysqld_safe &
Dec :: izwz932ypmamm80m434qqyz mysqld[]: You can test the MySQL daemon with mysql-test-run.pl
Dec :: izwz932ypmamm80m434qqyz mysqld[]: cd /usr/mysql-test ; perl mysql-test-run.pl
Dec :: izwz932ypmamm80m434qqyz mysqld[]: Please report any problems at http://bugs.mysql.com/
Dec :: izwz932ypmamm80m434qqyz mysqld[]: [ OK ]
Dec :: izwz932ypmamm80m434qqyz mysqld[]: MySQL Daemon failed to start.
Dec :: izwz932ypmamm80m434qqyz mysqld[]: Starting mysqld: [FAILED]
Dec :: izwz932ypmamm80m434qqyz systemd[]: mysqld.service: control process exited, code=exited status=
Dec :: izwz932ypmamm80m434qqyz systemd[]: Failed to start LSB: start and stop MySQL server.
-- Subject: Unit mysqld.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit mysqld.service has failed.
--
-- The result is failed.
Dec :: izwz932ypmamm80m434qqyz systemd[]: Unit mysqld.service entered failed state.
Dec :: izwz932ypmamm80m434qqyz systemd[]: mysqld.service failed.
Dec :: izwz932ypmamm80m434qqyz polkitd[]: Unregistered Authentication Agent for unix-process:: (system bus name :1.2579, object path /org/freed
Dec :: izwz932ypmamm80m434qqyz systemd[]: Started Session of user root.
-- Subject: Unit session-.scope has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit session-.scope has finished starting up.
--
-- The start-up result is done.
Dec :: izwz932ypmamm80m434qqyz systemd[]: Starting Session of user root.
-- Subject: Unit session-.scope has begun start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit session-.scope has begun starting up.
Dec :: izwz932ypmamm80m434qqyz CROND[]: (root) CMD (/usr/lib64/sa/sa1 )
启动失败,mysql告诉我可以执行后面两个命令看错误信息,我也做了,结果发现没鸟用。此时最好是能看到启动日志,可是我去/var/log目录一看,mysqld.log是空的。没办法,只能问万能的度娘了。按网友提供的一些建议,死马当活马医了。先是变更了mysql的数据文件目录,这件事虽然跟这个问题没啥关联,感觉这样做也是好的
mv /var/lib/mysql/ /data/
但启动依然失败,直接输入mysql报错:ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
突然发现还有事情没干,改了目录没改配置!接着编辑配置文件/etc/my.cnf,修改所有的socket为
socket = /data/mysql/mysql.sock
让mysql找到mysql.sock文件了。在[mysql]下新增
[mysqld]
datadir=/data/mysql
让mysql找到数据目录。可是报错依旧,已经没辙了。无奈下试了给数据目录data/mysql加上系统权限:
[root@izwz932ypmamm80m434qqyz /]# chown -R mysql:mysql data/mysql
再次执行启动成功:
[root@izwz932ypmamm80m434qqyz log]# service mysqld start
Starting mysqld (via systemctl): [ OK ]
[root@izwz932ypmamm80m434qqyz log]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is
Server version: 5.5.-log MySQL Community Server (GPL) by Atomicorp Copyright (c) , , Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
64位linux下rpm安装mysql的5.5.55版本的更多相关文章
- 64位linux源码安装mysql
一:下载mysql http://dev.mysql.com/downloads/mysql/中的Generally Available(GA) Releases标签页,在MySQL Communit ...
- Linux下yum安装MySQL
写这篇文章的原因是:在刚开始使用Linux操作系统时想要搭建LAMP环境,于是开始在Google和百度上各种寻找资料,碰到了不是很多的问题后,我决定写这篇文章总结一下在Linux下yum安装MySQL ...
- linux下如何安装mysql和redis
linux下如何安装mysql(mariadb) linux下如何安装软件? 1. yum安装软件也得注意,一个是配置yum源 1.我们当前的是阿里云的yum源(下载速度特别快) 通过 yum ins ...
- 在64位linux下编译32位程序
在64位linux下编译32位程序 http://blog.csdn.net/xsckernel/article/details/38045783
- 阿里云 centos7 64位搭建JAVA环境-----安装mysql(1)
一开始用的是阿里云镜像市场的JAVA集成环境,但是配置了好长时间配置不成功.索性就换成了纯净系统从零开始搭建JAVA环境. 镜像:centos_7_04_64_20G_alibase_20170101 ...
- Windows7 64位系统下无法安装网络打印机的解决方法
背景: 公司一台HP LaserJet 1010 打印机连在一台Windows XP的电脑上,而我的是windows7 64位系统,无法安装驱动解决办法:1:去惠普官网上下载对应的64位驱动(什么Vi ...
- [mysql使用(1)] 64位Linux下安装mysql-5.7.13-linux-glibc2.5-x86_64
由于公司临时让将Oracle的数据移植到mysql上面,所以让我在公司服务器上面安装一下mysql.下面就是我的安装过程以及一些错误解决思路.其实对于不同版本安装大体都有差不多. 1. 从官网下载 m ...
- 64位Linux下安装mysql-5.7.13-linux-glibc2.5-x86_64 || 转载:http://www.cnblogs.com/gaojupeng/p/5727069.html
由于公司临时让将Oracle的数据移植到mysql上面,所以让我在公司服务器上面安装一下mysql.下面就是我的安装过程以及一些错误解决思路.其实对于不同版本安装大体都有差不多. 1. 从官网下载 m ...
- 64位linux下安装ps模拟器ePSxe
早就想在爱机上玩ps游戏,特别是彩京的1945一代和非常经典的实况足球2002版.在ubuntu64位下可以通过wine模拟的方式运行windows版的ePSxe,但是总觉得差些呢?非原生啊!网上搜了 ...
随机推荐
- iOS日常学习 - iOS10上关于NSPhotoLibraryUsageDescription等问题
最近升级了Xcode8.0,真是很多坑啊,填完一个来另外一个,今天又遇到了一个,用Xcode8.0上传项目时被驳回说是info.plist里面没有设置NSPhotoLibraryUsageDescri ...
- Java web应用中的常见字符编码问题的解决方法
以下是 Java Web应用的常见编码问题 1. html页面的编码 在web应用中,通常浏览器会根据http header: Content-type的值来决定用什么encoding, 比如遇到Co ...
- DRBD分布式块设备复制
一. DRBD介绍 1.1.数据镜像软件DRBD介绍分布式块设备复制(Distributed Relicated Block Deivce,DRBD),是一种基于软件.基于网络的块复制存储解决方案,主 ...
- JAVA实现IP地址解析
转载至:http://blog.csdn.net/dragontang/article/details/4151660 http://www.iteye.com/topic/340548#
- Entity Framework 6 预热、启动优化
虽然文章题目是针对EF的,但涉及的内容不仅仅是EF. 场景介绍 目前在做的一个项目,行业门户,项目部分站点按域名划分如下: user.xxx.com:用户登陆注册 owner.xxx.com:个人用户 ...
- UIElement.IsMouseCaptured属性的应用
一个只读属性,该值描述了此元素是否捕获到了鼠标,如果该值为true,则说明此元素捕获到了鼠标:否则,未捕获到(例如:当鼠标进入到一个Button的可视化范围之内,当Button按钮外观效果发生了变化时 ...
- Django进阶Model篇007 - 聚集查询和分组查询
接着前面的例子,举例聚集查询和分组查询例子如下: 1.查询人民邮电出版社出了多少本书 >>> Book.objects.filter(publisher__name='人民邮电出版社 ...
- 将本地代码提交到gitlub
第一步:建立git仓库 cd到本地项目根路径下面,执行git命令:git init $ git init Initialized empty Git repository in D:/my_wor ...
- layui中实现上传图片压缩
一.关于js上传图片压缩的方法,百度有很多种方法,这里我参考修改了一下: function photoCompress(file, w, objDiv) { var ready = new FileR ...
- 条款32:确定public继承中塑造出来的是IS-A关系而不是其他的关系
首先考虑的是一个很典型的关系,就是矩形与正方形的关系: class Recantagle{ virtual void setHeight(int); virtual void setWidth(int ...