【澳门金沙vip】Linux下安装mysql

安装MYSQL错误“conflictswithfilefrompackagemysql-libs-*”解决方法

安装MYSQL的时候时:

错误现象:

 

[[email protected] opt]# rpm -ivh MySQL-server-5.5.32-1.el6.x86_64.rpm 
Preparing...                ########################################### [100%]
 file /usr/share/mysql/charsets/Index.xml from install of MySQL-server-5.5.32-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.61-4.el6.x86_64
 file /usr/share/mysql/charsets/armscii8.xml from install of MySQL-server-5.5.32-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.61-4.el6.x86_64
 file /usr/share/mysql/charsets/ascii.xml from install of MySQL-server-5.5.32-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.61-4.el6.x86_64
 file /usr/share/mysql/charsets/cp1250.xml from install of MySQL-server-5.5.32-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.61-4.el6.x86_64
 file /usr/share/mysql/charsets/cp1256.xml from install of MySQL-server-5.5.32-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.61-4.el6.x86_64
 file /usr/share/mysql/charsets/cp1257.xml from install of MySQL-server-5.5.32-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.61-4.el6.x86_64
 file /usr/share/mysql/charsets/cp850.xml from install of MySQL-server-5.5.32-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.61-4.el6.x86_64
 file /usr/share/mysql/charsets/cp852.xml from install of MySQL-server-5.5.32-1.el6.x86_64 conflicts with file from package mysql-libs-5.1.61-4.el6.x86_64

 

错误原因:

原因由包冲突引起的!

解决方法:

先移除冲突的libs包,再进行安装。

yum -y remove mysql-libs-5.1.61*

-y的意思就是不用询问是否remove卸载完成之后,

然后再执行命令

rpm -ivh MySQL-server-5.5.32-1.el6.x86_64.rpm

安装MySQL就可以成功了,如下:

 

 

[[email protected] opt]# rpm -ivh MySQL-server-5.5.32-1.el6.x86_64.rpm
Preparing...                ########################################### [100%]
   1:MySQL-server           ########################################### [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 localhost.localdomain 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!

[[email protected] opt]# 

 

安装MYSQL的时候时: 错误现象:
[[email protected]
opt]# rpm -ivh MySQL-server-5.5.32-1.el6.x86_…

Linux下安装mysql

一、简易安装
#yum install -y mysql-server mysql mysql-devel
如果报安装包冲突:
file /usr/share/mysql/ukrainian/errmsg.sys from install of
MySQL-server-5.5.18-1.rhel5.i386 conflicts with file from package
mysql-libs-5.0.46-1.rhel5.i386
把安装包卸载就可以了
#yum -y remove mysql-libs-5.0.46-1.rhel5.i386
-y的意思就是不用询问是否remove
卸载之后,再安装MySQL成功

二、手动安装
1、先上传安装包
/opt/MySQL-server-4.0.16-0.i386.rpm
/opt/MySQL-client-4.0.16-0.i386.rpm(视情况而定,不一定要装)
2、给文件增加执行权限
#cd /opt/ 切换到制定目录
#chmod a+x MySQL-server-4.0.16-0.i386.rpm 给文件增加执行权限
3、执行安装
#rpm -ivh MySQL-server-4.0.16-0.i386.rpm
如果安装过程报如下错误: file /usr/share/mysql/charsets/cp1251.xml from
install of MySQL-server-5.5.24-1.el6.i686 conflicts with file from
package mysql-libs-5.1.52-1.el6_0.1.i686 file
/usr/share/mysql/czech/errmsg.sys from install of
MySQL-server-5.5.24-1.el6.i686 conflicts with file from package
mysql-libs-5.1.52-1.el6_0.1.i686
原因由包冲突引起的!操作系统自带的某些包与mysql的包冲突,先移除冲突的libs包,在进行安装
#yum -y remove mysql-libs-5.1.52* -y的意思就是不用询问是否remove
卸载完成之后,如果报如下错误:
error: Failed dependencies: libc.so.6 is needed by
MySQL-server-community-5.1.63-1.rhel4.i386 libc.so.6(GLIBC_2.0) is
needed by MySQL-server-community-5.1.63-1.rhel4.i386
libc.so.6(GLIBC_2.1) is needed by
MySQL-server-community-5.1.63-1.rhel4.i386
缺少相关包引起的,安装相关包就可以了,如下:
#yum install libc.so.6
再次执行安装MySQL:

#rpm -ivh MySQL-server-4.0.16-0.i386.rpm

三、设置root密码 新安装的mysql,默认用户root没有密码,需要设置密码
#/usr/bin/mysqladmin -u root -p ‘123456’
如果报错,显示没有权限连接 mysqladmin: connect to server at ‘localhost’
failed error: ‘Access denied for user ‘root’@’localhost’ (using
password: YES)’
解决方法:
先关闭数据库 #service mysqld stop
再以不检查安全的方法启动 # mysqld_safe –user=mysql
–skip-grant-tables –skip-networking &
再登录 #mysql -u root mysql
再改密码 # UPDATE user SET Password=PASSWORD(‘newpassword’) where
USER=’root’ and host=’root’ or host=’localhost’; #FLUSH PRIVILEGES;
重启mysql #service mysqld restart 或者 #ps –aux | grep
mysqld命令找出mysql的进程号 然后执行kill -9 进程号杀掉mysql进程

四、授权远程用户登录 新安装的mysql,默认只有本机才能登录,其他电脑通过网络登录需要授权
先登陆 #/usr/bin/mysql -uroot -p
再授权 #grant all on *.* to
[email protected]’%’
identified by ‘123456’; #flush privileges;
好了,至此,mysql基本上可以使用了。

五、坑爹的事情
有一次在一台机子上装MYSQL,装好后一切都正常,可以在服务器上用命令行登录,但是就是没有mysql这个库,试过各种方法,重装多次,均不成功。临时的解决方案是,去其他正常的数据库中导一份mysql库过来,手动创建,能够正常使用,观察过一个月,没有任何问题。目前还不知道为什么mysql这个库没建起来

一、简易安装 #yum install -y
mysql-server mysql mysql-devel 如果报安装包冲突: file
/usr/share/mysql/ukrainian/errmsg.sys from install of MySQL-s…

一、简易安装
#yum install -y mysql-server mysql mysql-devel
如果报安装包冲突:
file /usr/share/mysql/ukrainian/errmsg.sys from install of
MySQL-server-5.5.18-1.rhel5.i386 conflicts with file from package
mysql-libs-5.0.46-1.rhel5.i386
把安装包卸载就可以了
#yum -y remove mysql-libs-5.0.46-1.rhel5.i386
-y的意思就是不用询问是否remove
卸载之后,再安装MySQL成功

二、手动安装
1、先上传安装包
/opt/MySQL-server-4.0.16-0.i386.rpm
/opt/MySQL-client-4.0.16-0.i386.rpm(视情况而定,不一定要装)
2、给文件增加执行权限
#cd /opt/ 切换到制定目录
#chmod a+x MySQL-server-4.0.16-0.i386.rpm 给文件增加执行权限
3、执行安装
#rpm -ivh MySQL-server-4.0.16-0.i386.rpm
如果安装过程报如下错误: file /usr/share/mysql/charsets/cp1251.xml from
install of MySQL-server-5.5.24-1.el6.i686 conflicts with file from
package mysql-libs-5.1.52-1.el6_0.1.i686 file
/usr/share/mysql/czech/errmsg.sys from install of
MySQL-server-5.5.24-1.el6.i686 conflicts with file from package
mysql-libs-5.1.52-1.el6_0.1.i686
原因由包冲突引起的!操作系统自带的某些包与mysql的包冲突,先移除冲突的libs包,在进行安装
#yum -y remove mysql-libs-5.1.52* -y的意思就是不用询问是否remove
卸载完成之后,如果报如下错误:
error: Failed dependencies: libc.so.6 is needed by
MySQL-server-community-5.1.63-1.rhel4.i386 libc.so.6(GLIBC_2.0) is
needed by MySQL-server-community-5.1.63-1.rhel4.i386
libc.so.6(GLIBC_2.1) is needed by
MySQL-server-community-5.1.63-1.rhel4.i386
缺少相关包引起的,安装相关包就可以了,如下:
#yum install libc.so.6
再次执行安装MySQL: