SUSE Linux Ubuntu 下安装mysql遇到的问题一。

用的是阿里云的新服务器,用的是Ubuntu不是Contos的在安装mysql的时候遇到了一些问题。在此记录一下。

1.创建目录用来下载安装包。

 命令:mkdir /usr/local/software(文件目录根据没有固定,根据自己喜好来创建)

MySQL-server-5.5.34-1.linux2.6.x86_64.rpm 第一个安装

MySQL-client-5.5.34-1.linux2.6.x86_64.rpm    第二个安装

下载地址:http://www.bdsola.com/d/43928254.html

2.开始安装mysql。

(因为服务器是刚买的什么都没装,所以装之前就不检测是否安装了mysql(检测命令:#rpm -qa | grep -i mysql)。如果不是新服务器装之前最好先看下是否安装了mysql,已经安装的话要记得,再起安装之前卸载之前的mysql(卸载命令:#rpm -ev 出现的mysql版本名称))

命令:rpm -ivh MySQL-server-5.5.34-1.linux2.6.x86_64.rpm(注意安装顺序)

然后就报错了.......如下:

rpm: RPM should not be used directly install RPM packages, use Alien instead!
rpm: However assuming you know what you are doing...
error: Failed dependencies:
/bin/sh is needed by MySQL-server-5.5.34-1.linux2.6.x86_64
/sbin/chkconfig is needed by MySQL-server-5.5.34-1.linux2.6.x86_64
/usr/bin/perl is needed by MySQL-server-5.5.34-1.linux2.6.x86_64
/usr/sbin/groupadd is needed by MySQL-server-5.5.34-1.linux2.6.x86_64
/usr/sbin/useradd is needed by MySQL-server-5.5.34-1.linux2.6.x86_64
coreutils is needed by MySQL-server-5.5.34-1.linux2.6.x86_64
grep is needed by MySQL-server-5.5.34-1.linux2.6.x86_64
libaio.so.1()(64bit) is needed by MySQL-server-5.5.34-1.linux2.6.x86_64
libaio.so.1(LIBAIO_0.1)(64bit) is needed by MySQL-server-5.5.34-1.linux2.6.x86_64
libaio.so.1(LIBAIO_0.4)(64bit) is needed by MySQL-server-5.5.34-1.linux2.6.x86_64
libc.so.6()(64bit) is needed by MySQL-server-5.5.34-1.linux2.6.x86_64
libc.so.6(GLIBC_2.2.5)(64bit) is needed by MySQL-server-5.5.34-1.linux2.6.x86_64
libc.so.6(GLIBC_2.3)(64bit) is needed by MySQL-server-5.5.34-1.linux2.6.x86_64
libcrypt.so.1()(64bit) is needed by MySQL-server-5.5.34-1.linux2.6.x86_64
libcrypt.so.1(GLIBC_2.2.5)(64bit) is needed by MySQL-server-5.5.34-1.linux2.6.x86_64
libdl.so.2()(64bit) is needed by MySQL-server-5.5.34-1.linux2.6.x86_64
libdl.so.2(GLIBC_2.2.5)(64bit) is needed by MySQL-server-5.5.34-1.linux2.6.x86_64
libm.so.6()(64bit) is needed by MySQL-server-5.5.34-1.linux2.6.x86_64
libm.so.6(GLIBC_2.2.5)(64bit) is needed by MySQL-server-5.5.34-1.linux2.6.x86_64
libpthread.so.0()(64bit) is needed by MySQL-server-5.5.34-1.linux2.6.x86_64
libpthread.so.0(GLIBC_2.2.5)(64bit) is needed by MySQL-server-5.5.34-1.linux2.6.x86_64
libpthread.so.0(GLIBC_2.3.2)(64bit) is needed by MySQL-server-5.5.34-1.linux2.6.x86_64
librt.so.1()(64bit) is needed by MySQL-server-5.5.34-1.linux2.6.x86_64
librt.so.1(GLIBC_2.2.5)(64bit) is needed by MySQL-server-5.5.34-1.linux2.6.x86_64
procps is needed by MySQL-server-5.5.34-1.linux2.6.x86_64

难过一脸懵逼加发呆。。。。。看错误是缺少依赖的包。老子都还没装你怎么依赖?网上说的是要用yum来装,这个功能最强大的就是他在装的时候回查看所依赖的包,都给你装上去。我也试过了。。。。不行。装了yum之后要配置yum的源文件,来让他知道去哪里下载相关的包。详情看下这篇文章。http://www.lupaworld.com/article-221217-1.html。建议不要装!

提示缺少依赖那就不让他关心依赖的事不就行了。安装的时候添加命令:--nodeps。

# rpm -ivh MySQL-server-5.5.34-1.linux2.6.x86_64.rpm --nodeps

rpm: RPM should not be used directly install RPM packages, use Alien instead!
rpm: However assuming you know what you are doing...
Preparing...                          ################################# [100%]
Updating / installing...
   1:MySQL-server-5.5.34-1.linux2.6   ################################# [100%]


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 iZ8vb9i5ltk2pp7t8vjxpkZ 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.


Please report any problems with the /usr/bin/mysqlbug script!

OK!server安装成功。

# rpm -ivh MySQL-client-5.5.34-1.linux2.6.x86_64.rpm --nodeps
rpm: RPM should not be used directly install RPM packages, use Alien instead!
rpm: However assuming you know what you are doing...
Preparing...                          ################################# [100%]
Updating / installing...
   1:MySQL-client-5.5.34-1.linux2.6   ################################# [100%]

OK!client安装成功。

3.了解下默认安装位置及作用

1.数据库目录      /var/lib/mysql/ 
2.配置文件      /usr/share/mysql   (mysql.server命令及配置文件) 
3.相关命令        /usr/bin            (mysqladmin mysqldump等命令) 
4.启动脚本      /etc/rc.d/init.d/  (启动脚本文件mysql的目录) 如:/etc/rc.d/init.d/mysql start/restart/stop/status
特别说明:SuSE Linux的启动脚本目录在  /etc/init.d 目录下,并且MySQL安装完成后,会缺少mysql.sock这个套接字文件,所以必须到这个目录下才能启动mysql。

4.查看mysql是否安装成功

#rpm -qa | grep -i mysql
MySQL-client-5.5.34-1.linux2.6.x86_64
MySQL-server-5.5.34-1.linux2.6.x86_64

OK! mysql5.5安装成功。

剩下的推荐一篇详细的mysql安装教程文章:http://blog.csdn.net/skylinethj/article/details/38856295。


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值