1.卸载系统自带的mysql

[root@zhangmeng ~]# rpm -qa |grep mysql
mysql-libs-5.1.-.el6_3.x86_64
[root@zhangmeng ~]#
[root@zhangmeng ~]# rpm -e mysql-libs-5.1.-.el6_3.x86_64;
error: Failed dependencies:
libmysqlclient.so.()(64bit) is needed by (installed) postfix-:2.6.-2.2.el6_1.x86_64
libmysqlclient.so.(libmysqlclient_16)(64bit) is needed by (installed) postfix-:2.6.-2.2.el6_1.x86_64
mysql-libs is needed by (installed) postfix-:2.6.-2.2.el6_1.x86_64
[root@zhangmeng ~]#
[root@zhangmeng ~]# rpm -e mysql-libs-5.1.-.el6_3.x86_64 --nodeps;
[root@zhangmeng ~]#
[root@zhangmeng ~]#
[root@zhangmeng ~]# rpm -qa |grep mysql

2.下载mysql安装包,需要安装wget用 yum -y install wget

[root@zhangmeng ~]# wget http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm
-bash: wget: command not found
[root@zhangmeng ~]#
[root@zhangmeng ~]#
[root@zhangmeng ~]# yum -y install wget
Loaded plugins: fastestmirror
Determining fastest mirrors
* base: mirrors.cn99.com
* extras: mirrors.cn99.com
* updates: mirrors.sohu.com
base | 3.7 kB :
extras | 3.4 kB :
updates | 3.4 kB :
updates/primary_db | 2.5 MB :

3.再次下载

[root@zhangmeng ~]# wget http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm
---- ::-- http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm
Resolving repo.mysql.com... 104.102.164.25
Connecting to repo.mysql.com|104.102.164.25|:... connected.
HTTP request sent, awaiting response... OK
Length: (.7K) [application/x-redhat-package-manager]
Saving to: ?.ysql-community-release-el6-.noarch.rpm? %[==============================================>] , --.-K/s in .001s -- :: (9.44 MB/s) - ?.ysql-community-release-el6-.noarch.rpm?.saved [/] [root@zhangmeng ~]# ls
anaconda-ks.cfg install.log.syslog
install.log mysql-community-release-el6-.noarch.rpm
[root@zhangmeng ~]#

4.安装

[root@zhangmeng ~]# rpm -ivh mysql-community-release-el6-.noarch.rpm
Preparing... ########################################### [%]
:mysql-community-release########################################### [%]
[root@zhangmeng ~]#
[root@zhangmeng ~]# rpm -qa |grep -i mysql
mysql-community-release-el6-.noarch

5.安装mysql数据库

[root@zhangmeng ~]# yum install mysql-community-server -y
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.cn99.com
* extras: mirrors.cn99.com
* updates: mirrors.sohu.com
mysql-connectors-community | 2.5 kB :
mysql-connectors-community/primary_db | kB :
mysql-tools-community | 2.5 kB :
mysql-tools-community/primary_db | kB :
mysql56-community | 2.5 kB :
mysql56-community/primary_db | kB :
Setting up Install Process
......
......
========================================================================================
 Package                    Arch       Version              Repository             Size
========================================================================================
Installing:
 mysql-community-server     x86_64     5.6.37-2.el6         mysql56-community      55 M
Installing for dependencies:
 libaio                     x86_64     0.3.107-10.el6       base                   21 k
 mysql-community-client     x86_64     5.6.37-2.el6         mysql56-community      18 M
 mysql-community-common     x86_64     5.6.37-2.el6         mysql56-community     308 k
 mysql-community-libs       x86_64     5.6.37-2.el6         mysql56-community     1.9 M
 numactl                    x86_64     2.0.9-2.el6          base                   74 k
 perl                       x86_64     4:5.10.1-144.el6     base                   10 M
 perl-DBI                   x86_64     1.609-4.el6          base                  705 k
 perl-Module-Pluggable      x86_64     1:3.90-144.el6       base                   41 k
 perl-Pod-Escapes           x86_64     1:1.04-144.el6       base                   33 k
 perl-Pod-Simple            x86_64     1:3.13-144.el6       base                  213 k
 perl-libs                  x86_64     4:5.10.1-144.el6     base                  579 k
 perl-version               x86_64     3:0.77-144.el6       base                   52 k Transaction Summary
========================================================================================
Install      13 Package(s) Total download size: 86 M
Installed size: 373 M
Downloading Packages:
(1/13): libaio-0.3.107-10.el6.x86_64.rpm                         |  21 kB     00:00     
(2/13): mysql-community-client-5.6.37-2.el6.x86_64.rpm           |  18 MB     00:17     
(3/13): mysql-community-common-5.6.37-2.el6.x86_64.rpm           | 308 kB     00:01     
(4/13): mysql-community-libs-5.6.37-2.el6.x86_64.rpm             | 1.9 MB     00:03     
(5/13): mysql-community-server-5.6.37-2.el6.x86_64.rpm           |  55 MB     00:49     
(6/13): numactl-2.0.9-2.el6.x86_64.rpm                           |  74 kB     00:00     
(7/13): perl-5.10.1-144.el6.x86_64.rpm                           |  10 MB     00:04     
(8/13): perl-DBI-1.609-4.el6.x86_64.rpm                          | 705 kB     00:00     
(9/13): perl-Module-Pluggable-3.90-144.el6.x86_64.rpm            |  41 kB     00:00     
(10/13): perl-Pod-Escapes-1.04-144.el6.x86_64.rpm                |  33 kB     00:00     
(11/13): perl-Pod-Simple-3.13-144.el6.x86_64.rpm                 | 213 kB     00:00     
(12/13): perl-libs-5.10.1-144.el6.x86_64.rpm                     | 579 kB     00:00     
(13/13): perl-version-0.77-144.el6.x86_64.rpm                    |  52 kB     00:00     
----------------------------------------------------------------------------------------
......
......
Installed:
  mysql-community-server.x86_64 0:5.6.37-2.el6                                           Dependency Installed:
  libaio.x86_64 0:0.3.107-10.el6                                                        
  mysql-community-client.x86_64 0:5.6.37-2.el6                                          
  mysql-community-common.x86_64 0:5.6.37-2.el6                                          
  mysql-community-libs.x86_64 0:5.6.37-2.el6                                            
  numactl.x86_64 0:2.0.9-2.el6                                                          
  perl.x86_64 4:5.10.1-144.el6                                                          
  perl-DBI.x86_64 0:1.609-4.el6                                                         
  perl-Module-Pluggable.x86_64 1:3.90-144.el6                                           
  perl-Pod-Escapes.x86_64 1:1.04-144.el6                                                
  perl-Pod-Simple.x86_64 1:3.13-144.el6                                                 
  perl-libs.x86_64 4:5.10.1-144.el6                                                     
  perl-version.x86_64 3:0.77-144.el6                                                     Complete!
[root@zhangmeng ~]#

6.查看安装后的mysql

[root@zhangmeng ~]# rpm -qa |grep -i mysql
mysql-community-release-el6-.noarch
mysql-community-common-5.6.-.el6.x86_64
mysql-community-server-5.6.-.el6.x86_64
mysql-community-libs-5.6.-.el6.x86_64
mysql-community-client-5.6.-.el6.x86_64
[root@zhangmeng ~]#

7.将mysql设置为开机启动

[root@zhangmeng ~]# chkconfig --list |grep mysqld
mysqld :off :off :off :on :on :on :off
[root@zhangmeng ~]#
[root@zhangmeng ~]# chkconfig mysqld on
[root@zhangmeng ~]#
[root@zhangmeng ~]# chkconfig --list |grep mysqld
mysqld :off :off :on :on :on :on :off
[root@zhangmeng ~]#

8.重启mysql服务

[root@zhangmeng ~]# mysqladmin -u root password 'root'
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' ()'
Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists!
[root@zhangmeng ~]#
[root@zhangmeng ~]#
[root@zhangmeng ~]#
[root@zhangmeng ~]# service mysqld restart
Stopping mysqld: [ OK ]
......
......

9.配置mysql root 用户密码

[root@zhangmeng ~]# mysqladmin -u root password ''
Warning: Using a password on the command line interface can be insecure.
[root@zhangmeng ~]#

10.修改 mysql root 用户密码,下面新密码是以明文形式显示,故提示警告,建议采用密文形式

Warning: Using a password on the command line interface can be insecure.警告:在命令行界面上使用密码可能是不安全的。
[root@zhangmeng ~]# mysqladmin -uroot -p123456 password abc123
Warning: Using a password on the command line interface can be insecure.
[root@zhangmeng ~]#

11.登录mysql,查看root账号信息,修改密码后,再次查看root账号信息

[root@zhangmeng ~]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is
Server version: 5.6. MySQL Community Server (GPL) 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.
mysql>
mysql> use mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A Database changed
mysql>mysql> select Host,User,Password from user where User='root';
+-----------------------+------+-------------------------------------------+
| Host                  | User | Password                                  |
+-----------------------+------+-------------------------------------------+
| localhost             | root | *6691484EA6B50DDDE1926A220DA01FA9E575C18A |
| zhangmeng.example.com | root |                                           |
| 127.0.0.1             | root |                                           |
| ::1                   | root |                                           |
+-----------------------+------+-------------------------------------------+
4 rows in set (0.00 sec) mysql> update user set password =password(123456) where user='root';
Query OK, 4 rows affected (0.28 sec)
Rows matched: 4  Changed: 4  Warnings: 0 mysql> select Host,User,Password from user where User='root';
+-----------------------+------+-------------------------------------------+
| Host                  | User | Password                                  |
+-----------------------+------+-------------------------------------------+
| localhost             | root | *6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9 |
| zhangmeng.example.com | root | *6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9 |
| 127.0.0.1             | root | *6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9 |
| ::1                   | root | *6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9 |
+-----------------------+------+-------------------------------------------+

【MYSQL安装】mysql 5.6在centos6.4上的安装的更多相关文章

  1. 【MySQL安装】MySQL5.6在centos6.4上的安装

    卸载原来安装的mysql 安装从官网下载的mysql rpm包 发现有依赖,需要先安装libaio包和libnuma包 再装mysql就可以了 安装客户端 安装完成后,启动mysql 但是发现用没有m ...

  2. centos6.8上yum安装zabbix3.2

    centos6.8上yum安装zabbix3.2 zabbix3.2安装文档:https://www.zabbix.com/documentation/3.2/manual/installation/ ...

  3. MySQL 8.0.18 在 Windows Server 2019 上的安装(ZIP)公开

    AskScuti MySQL : Windows Server 2019 安装 MySQL 8.0 温馨提示:为了展现我最“魅力”的一面,请用谷歌浏览器撩我. 一切就绪,点我开撩

  4. MySQL 8.0.18 在 Windows Server 2019 上的安装(MSI)公开

    AskScuti MySQL : Windows Server 2019 安装 MySQL 8.0 温馨提示:为了展现我最“魅力”的一面,请用谷歌浏览器撩我.那个 IE 啊,我很无奈. 一切就绪,点我 ...

  5. 自己编写的:centos6.6上编译安装apache2.4+php5.6+mysql5.6【亲自】

    在centos6.6上安装apache2.4+php5.6+mysql5.6 关于wget的安装 将之前装系统的.iso文件挂载到光驱 由于我在/home/jinnan/下建立了一个cdrom文件夹 ...

  6. aliyun CentOS6.5 上 svn 安装笔记

    为了方便管理自己的一些学习资料.总结等,在CentOS6.5上安装SVN,记录过程如下: 1.1  安装方式  独立服务器  fsfs SVN服务器有2种运行方式:独立安装.SVN+Apache.独立 ...

  7. 在centos6,7 上编译安装内核

      小编以前写过一篇软件的源码编译安装,今天小编再给大家带来一篇内核的编译安装.   今天,就以centos7 编译安装最新版本4.13.2 内核为例,给大家详解.编译安装之前,检查一下自己的磁盘空间 ...

  8. centos6.9上mongdb安装

    一.设置yum源 vi /etc/yum.repos.d/mongodb.repo [mongodb-org-3.2] name=MongoDB Repository baseurl=https:// ...

  9. python3在centos6.6上的安装

    建议:在看这个文档操作前,最好先参考一下这个:https://www.cnblogs.com/bookwed/p/10251236.html,是解决pip安装模块时,提示ssl版本低的问题. #提前的 ...

随机推荐

  1. C语言文件操作总结

    文件的打开操作 fopen 打开一个文件,操作文件指针FILE * 文件的关闭操作 fclose 关闭一个文件 文件的读写操作 fgetc 从文件中读取一个字符 fputc 写一个字符到文件中去 fg ...

  2. 日常踩坑——Dev C++ pow()函数的坑

    坑 Dev C++ pow()函数 那年冬天,显示屏前坐着如喽啰,那时候我含泪发誓,再也不用Dev. 蓝桥杯官网给提供的版本,没办法bug也得硬着头皮用. 16年蓝桥杯的第八题 四平方和定理: 在De ...

  3. Linux常用监控服务器性能命令

    列举比较常用的几种监控服务器性能的Linux命令.其实,在我看来,目前针对Linux系统内存.硬盘.TCP/IP等等相关的指标,Linux本身自带的或者是一些开源项目等基本上都能达到这个获取服务器性能 ...

  4. HDU 1176 免费馅饼 (类似数字三角形的题,很经典,值得仔细理解的dp思维)

    题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=1176 免费馅饼 Time Limit: 2000/1000 MS (Java/Others)     ...

  5. DPDK运行出现EAL Error reading from file descriptor 23 Input output error

    原因 dpdk不支持该网卡导致,需要修改一行代码,跳过dpdk pci 检查. 解决方法 修改lib/librte_eal/linuxapp/igb_uio/igb_uio.c 将文件中该行修改 pc ...

  6. 极光客户互动云java post请求

    package com.common.utils; import java.io.IOException; import java.net.URLDecoder; import java.util.M ...

  7. 「微信小程序」PHP异步进程async-helper实例详解

    PHP异步进程async-helper实例详解 PHP 的异步进程助手,借助于 AMQP 实现异步执行 PHP 的方法,将一些很耗时.追求高可用.需要重试机制的操作放到异步进程中去执行,将你的 HTT ...

  8. HTTPweb服务器——HTTP基本知识

    对于HTTP来说,我们不需要说太多,HTTP又叫做超文本传输协议,现如今利用最多的版本是1.1版本. HTTP的特点:C/S模式,B/S模式 简单快速:基于请求和响应,请求只需要传送请求方法和路径.  ...

  9. Docker安装(yum方式 centos7)

    yum install -y yum-utils device-mapper-persistent-data lvm2   yum-config-manager --add-repo http://m ...

  10. IComparer 与 IComparable

    static void Main() { var people = new ArrayList(); people.AddRange(new ArrayList { }, }, }, } }); Co ...