CentOS6.5系统下RPM包安装MySQL5.6

From:http://www.linuxidc.com/Linux/2015-04/116003.htm

1.查看操作系统相关信息。

[[email protected] ~]# cat /etc/issue
CentOS release 6.5 (Final)
Kernel \r on an \m
[[email protected] ~]# uname -a
Linux linuxidc 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

x86_64是64位,如果还不确定,可以再换个命令

#getconf LONG_BIT
64 

2.创建需要下载rpm软件包的目录。
1 [[email protected] ~]# mkdir -p /taokey/tools

3.查看下是否有系统自带mysql的rpm包,如果有,需要删除自带的旧rpm包。

[[email protected] ~]# rpm -qa | grep mysql
mysql-libs-5.1.71-1.el6.x86_64
[[email protected] ~]# yum -y remove mysql-libs-5.1*
[[email protected] ~]# rpm -qa | grep mysql
[[email protected] ~]#

  

4.在MySQL官网下载安装MySQL-5.6.21所需的rpm软件包。
需要下载三个rpm软件包:
MySQL-client-5.6.21-1.rhel5.x86_64.rpm  
MySQL-devel-5.6.21-1.rhel5.x86_64.rpm  
MySQL-server-5.6.21-1.rhel5.x86_64.rpm

[[email protected] ~]# cd /taokey/tools/
[[email protected] tools]# wget http://dev.mysql.com/Downloads/MySQL-5.6/MySQL-server-5.6.21-1.rhel5.x86_64.rpm
[[email protected] tools]# wget http://dev.mysql.com/Downloads/MySQL-5.6/MySQL-devel-5.6.21-1.rhel5.x86_64.rpm
[[email protected] tools]# wget http://dev.mysql.com/Downloads/MySQL-5.6/MySQL-client-5.6.21-1.rhel5.x86_64.rpm

5.下载完之后,安装三个rpm软件包。

[[email protected] tools]# rpm -ivh MySQL-server-5.6.21-1.rhel5.x86_64.rpm
error: Failed dependencies:
        libaio.so.1()(64bit) is needed by MySQL-server-5.6.21-1.rhel5.x86_64
        libaio.so.1(LIBAIO_0.1)(64bit) is needed by MySQL-server-5.6.21-1.rhel5.x86_64
        libaio.so.1(LIBAIO_0.4)(64bit) is needed by MySQL-server-5.6.21-1.rhel5.x86_64

  

安装MySQL-server报错,原因是没有安装libaio,系统缺少libaio.so此软件包,下边yum安装一下libaio.so软件包。

[[email protected] tools]# yum install -y libaio
[[email protected] tools]# rpm -ivh MySQL-server-5.6.21-1.rhel5.x86_64.rpm
[[email protected] tools]# rpm -ivh MySQL-client-5.6.21-1.rhel5.x86_64.rpm
Preparing...                ########################################### [100%]
  1:MySQL-client          ########################################### [100%]
[[email protected] tools]# rpm -ivh MySQL-devel-5.6.21-1.rhel5.x86_64.rpm
Preparing...                ########################################### [100%]
  1:MySQL-devel            ########################################### [100%]

  

6.修改配置文件位置。

[[email protected] tools]# cp /usr/share/mysql/my-default.cnf /etc/my.cnf

  

7.初始化MySQL及修改MySQL默认的root密码。

[[email protected] tools]# /usr/bin/mysql_install_db
[[email protected] tools]# ps -ef | grep mysql
root      2188    1  0 14:48 pts/1    00:00:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/linuxidc.pid
mysql    2303  2188 30 14:48 pts/1    00:00:02 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/var/lib/mysql/linuxidc.err --pid-file=/var/lib/mysql/linuxidc.pid
root      2331  1853  0 14:49 pts/1    00:00:00 grep mysql
[[email protected] tools]# netstat -anpt | grep 3306
tcp        0      0 :::3306                    :::*                        LISTEN      2303/mysqld
[[email protected] tools]# more /root/.mysql_secret
# The random password set for the root user at Thu Apr  9 14:43:59 2015 (local time): F6K3v_xggFoLQeiN 

[[email protected] tools]# mysql -uroot -pF6K3v_xggFoLQeiN
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.21 

Copyright (c) 2000, 2014, 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. 

mysql> SET PASSWORD = PASSWORD(‘123.com‘);
mysql> exit
Bye
[[email protected] tools]# mysql -uroot -p123.com
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 6
Server version: 5.6.21 MySQL Community Server (GPL) 

Copyright (c) 2000, 2014, 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. 

mysql>

  

8.设置MySQL服务开机自启动。

[[email protected] tools]# chkconfig mysql on
[[email protected] tools]# chkconfig mysql --list
mysql          0:off  1:off  2:on    3:on    4:on    5:on    6:off

  

到此为止,使用RPM安装MySQL5.6版本数据库安装完毕,谢谢大家。

时间: 2024-11-02 23:40:34

CentOS6.5系统下RPM包安装MySQL5.6的相关文章

MySQL数据库系列之Centos6.5系统下RPM包安装MySQL5.6

查看操作系统相关信息. [[email protected]_db1 ~]# cat /etc/issue CentOS release 6.5 (Final) Kernel \r on an \m [[email protected]_db1 ~]# uname -a Linux bj_db1 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux 2.创建需要下载rpm软

CentOS6.5系统下RPM包安装MySQL5.6(转)

1.查看操作系统相关信息. [[email protected] ~]# cat /etc/issue CentOS release 6.5 (Final) Kernel \r on an \m [[email protected] ~]# uname -a Linux linuxidc 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux 2.创建需要下载rpm软件包的目

Salt之CentOS7.5使用RPM包安装MySQL5.7.22

手动安装参考CentOS7.5使用RPM包安装MySQL5.7.22 目录结构为 install.sls文件 #按顺序分别安装commin libs client server #避免冲突安装common前需要卸载mysql-libs mysql-common-install: file.managed: - name: /opt/mysql-community-common-5.7.22-1.el7.x86_64.rpm - source: salt://mysql/files/mysql-c

无外网情况下RPM方式安装MySQL5.6

RPM方式安装MySQL5.6 a. 检查MySQL及相关RPM包,是否安装,如果有安装,则移除(rpm –e 名称) 1 [[email protected] ~]# rpm -qa | grep -i mysql 2 mysql-libs-5.1.66-2.el6_3.x86_64 3 [[email protected] ~]# yum -y remove mysql-libs* b. 下载Linux对应的RPM包,如:CentOS6.4_64对应的RPM包,如下:这里给出我下载好的包,官

CentOS6.8 下RPM方式安装MySQL5.6

1. 检查MySQL及相关RPM包,是否安装,如果有安装,则移除(rpm –e 名称) yum remove mysql mysql-server mysql-libs(我用的上面的)或者 [[email protected] ~]# rpm -qa | grep mysql mysql-libs-5.1.71-1.el6.x86_64 [[email protected] ~]# yum -y remove mysql-libs-5.1* [[email protected] ~]# rpm

CentOS下RPM方式安装MySQL5.6(转载)

之前的项目全都在windows系统环境下部署的,这次尝试在Linux系统环境下部署,于是这次我们组织在7台主机上安装了JDK.Maven.Jboss其中一台安装了Mysql,并将局域网配置好,终于大功告成了.下面将安装步骤与大家分享! 系统版本:centos6.3-i386 32位操作系统 硬件配置:内核 Intel(R) Pentium(R) 4 CPU 3.00GHz 内存998.5M 安装环境:使用shell 命令 此次安装在桌面环境下,使用shell命令进行安装,下载安装包为: MySQ

linux下rpm方式安装mysql5.6及问题解决

安装环境:rhel6.5   mysql5.6 1.查看当前系统下是否安装了mysql rpm -qa | grep mysql 2.如果以上执行后相关包,则需要移除,两种方式 rpm -e packagename     //普通的删除 rpm -e --nodeps packagename     //强力删除,删除带有依赖关系的包 3.下载相关mysql5.6相关的包 wget http://cdn.mysql.com/archives/mysql-5.6/MySQL-client-5.6

Linux_RedHat下 RPM方式安装MySQL5.6

此次安装在桌面环境下,使用shell命令进行安装,下载安装包为: MySQL-5.6.25-1.linux_glibc2.5.i386.rpm-bundle.tar: a. 检查MySQL及相关RPM包,是否安装,如果有安装,则移除(rpm –e 名称) 1 [[email protected] ~]# rpm -qa | grep -i mysql 2 mysql-libs-5.1.66-2.el6_3.x86_64 3 [[email protected] ~]# yum -y remove

【华为云技术分享】CentOS7.4系统下,手动安装MySQL5.7的方法

MySQL数据库应用广泛,尤其对于JAVA程序员,不会陌生.如果在不想采购云数据库的情况下,可以自行安装MySQL数据库.文章将介绍,手动在CentOS7.4环境下,安装MySQL5.7版本的方法. 1.安装MySQL版本:5.7.25 2.下载地址 https://dev.mysql.com/downloads/mysql/5.7.html#downloads(随着时间的推移,请以最新的下载地址为准) 3.使用wget命令使用断点传输的方式,下载相关rpm文件 (如果地址有更新,请以最新为准)