centos6.9下rpm方式如何安装mysql-创新互联

下面讲讲关于centos 6.9 下rpm方式如何安装mysql,文字的奥妙在于贴近主题相关。所以,闲话就不谈了,我们直接看下文吧,相信看完centos 6.9 下rpm方式如何安装mysql这篇文章你一定会有所受益。

蓬溪ssl适用于网站、小程序/APP、API接口等需要进行数据传输应用场景,ssl证书未来市场广阔!成为成都创新互联的ssl证书销售渠道,可以享受市场价格4-6折优惠!如果有意向欢迎电话联系或者加微信:18982081108(备注:SSL证书合作)期待与您的合作!

在centos 6.9 上rpm安装mysql

环境:

Linux:CentOS release 6.9 64bit

MySQL: mysq-5.7.18

1、在/home创建mysql目录,下载如下四个软件包

http://mirrors.sohu.com/mysql/MySQL-5.7/

wget http://mirrors.sohu.com/mysql/MySQL-5.7/mysql-community-client-5.7.18-1.el6.x86_64.rpm

wget http://mirrors.sohu.com/mysql/MySQL-5.7/mysql-community-common-5.7.18-1.el6.x86_64.rpm

wget http://mirrors.sohu.com/mysql/MySQL-5.7/mysql-community-libs-5.7.18-1.el6.x86_64.rpm

wget http://mirrors.sohu.com/mysql/MySQL-5.7/mysql-community-server-5.7.18-1.el6.x86_64.rpm

centos 6.9 下rpm方式如何安装mysql

2、检查mysql rpm相关的包是否安装并去除

[root@centos-6 mysql]# rpm -qa | grep -i mysql

mysql-libs-5.1.73-8.el6_8.x86_64

[root@centos-6 mysql]# rpm -e mysql-libs-5.1.73-8.el6_8.x86_64

error: Failed dependencies:

libmysqlclient.so.16()(64bit) is needed by (installed) postfix-2:2.6.6-8.el6.x86_64

libmysqlclient.so.16(libmysqlclient_16)(64bit) is needed by (installed) postfix-2:2.6.6-8.el6.x86_64

mysql-libs is needed by (installed) postfix-2:2.6.6-8.el6.x86_64

[root@centos-6 mysql]#

将依赖包一并删除

[root@centos-6 mysql]# yum remove -y mysql-libs

再次查询是否删除干净

[root@centos-6 mysql]# rpm -qa | grep -i mysql

[root@centos-6 mysql]#

3、同时安装这四个rpm包

rpm -ivh mysql-community-client-5.7.18-1.el6.x86_64.rpm mysql-community-common-5.7.18-1.el6.x86_64.rpm mysql-community-libs-5.7.18-1.el6.x86_64.rpm mysql-community-server-5.7.18-1.el6.x86_64.rpm

4、出现缺少依赖包解决方式

[root@centos-6 home]# rpm -ivh mysql-community-client-5.7.18-1.el6.x86_64.rpm mysql-community-common-5.7.18-1.el6.x86_64.rpm mysql-community-libs-5.7.18-1.el6.x86_64.rpm mysql-community-server-5.7.18-1.el6.x86_64.rpm

warning: mysql-community-client-5.7.18-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY

error: Failed dependencies:

libnuma.so.1()(64bit) is needed by mysql-community-server-5.7.18-1.el6.x86_64

libnuma.so.1(libnuma_1.1)(64bit) is needed by mysql-community-server-5.7.18-1.el6.x86_64

libnuma.so.1(libnuma_1.2)(64bit) is needed by mysql-community-server-5.7.18-1.el6.x86_64

[root@centos-6 home]# yum install -y numactl

5、密码获取

第一次通过#grep "password" /var/log/mysqld.log 命令获取MySQL的临时密码

用该密码登录到服务端后,必须马上修改密码,不然操作查询时报错误

刚开始设置的密码必须符合长度,且必须含有数字,小写或大写字母,特殊字符。

如果想设置简单密码,如下操作:

首先,修改validate_password_policy参数的值

mysql> set global validate_password_policy=0;  #定义复杂度

mysql> set global validate_password_length=1;  #定义长度 默认是8

mysql>set password for 'root'@'localhost'=password('123456');  #设置root密码为123456

mysql> flush privileges; #刷新权限使配置生效

对于以上centos 6.9 下rpm方式如何安装mysql相关内容,大家还有什么不明白的地方吗?或者想要了解更多相关,可以继续关注我们的行业资讯板块。

另外有需要云服务器可以了解下创新互联cdcxhl.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。


名称栏目:centos6.9下rpm方式如何安装mysql-创新互联
网页网址:http://ybzwz.com/article/ccpoic.html