1.查看数据库中已安装的版本:

[mdata@bogon ~]$ yum list installed|grep mysql
mysql-libs.x86_64 5.1.71-1.el6 @anaconda-CentOS-201311272149.x86_64/6.5

2.移除数据库中已有的版本:
[root@bogon mdata]# yum -y remove mysql-libs.x86_64
...

Complete!

3.下载mysql数据库安装包:

[root@bogon mdata]# wget http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm
--2018-04-12 03:07:43-- http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm
Resolving repo.mysql.com... 23.55.208.125
Connecting to repo.mysql.com|23.55.208.125|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5824 (5.7K) [application/x-redhat-package-manager]
Saving to: “mysql-community-release-el6-5.noarch.rpm”

100%[======================================>] 5,824 11.7K/s in 0.5s

2018-04-12 03:07:43 (11.7 KB/s) - “mysql-community-release-el6-5.noarch.rpm” saved [5824/5824]

4.解压压缩包:

[root@bogon mdata]# rpm -ivh mysql-community-release-el6-5.noarch.rpm
Preparing... ########################################### [100%]
1:mysql-community-release########################################### [100%]

5.查看解压结果:
[root@bogon mdata]# yum repolist all|grep mysql
mysql-connectors-community MySQL Connectors Community enabled: 45
mysql-connectors-community-source MySQL Connectors Community - So disabled
mysql-tools-community MySQL Tools Community enabled: 57
mysql-tools-community-source MySQL Tools Community - Source disabled
mysql55-community MySQL 5.5 Community Server disabled
mysql55-community-source MySQL 5.5 Community Server - So disabled
mysql56-community MySQL 5.6 Community Server enabled: 415
mysql56-community-source MySQL 5.6 Community Server - So disabled
mysql57-community-dmr MySQL 5.7 Community Server Deve disabled
mysql57-community-dmr-source MySQL 5.7 Community Server Deve disabled

6.安装mysql数据库:
[root@bogon mdata]# yum install mysql-community-server -y
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirror.bit.edu.cn
* updates: mirror.bit.edu.cn
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package mysql-community-server.x86_64 0:5.6.39-2.el6 will be installed
--> Processing Dependency: mysql-community-common(x86-64) = 5.6.39-2.el6 for package: mysql-community-server-5.6.39-2.el6.x86_64
--> Processing Dependency: mysql-community-client(x86-64) >= 5.6.10 for package: mysql-community-server-5.6.39-2.el6.x86_64
--> Processing Dependency: perl(DBI) for package: mysql-community-server-5.6.39-2.el6.x86_64
--> Running transaction check
---> Package mysql-community-client.x86_64 0:5.6.39-2.el6 will be installed
--> Processing Dependency: mysql-community-libs(x86-64) >= 5.6.10 for package: mysql-community-client-5.6.39-2.el6.x86_64
---> Package mysql-community-common.x86_64 0:5.6.39-2.el6 will be installed
---> Package perl-DBI.x86_64 0:1.609-4.el6 will be installed
--> Running transaction check
---> Package mysql-community-libs.x86_64 0:5.6.39-2.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
mysql-community-server x86_64 5.6.39-2.el6 mysql56-community 55 M
Installing for dependencies:
mysql-community-client x86_64 5.6.39-2.el6 mysql56-community 18 M
mysql-community-common x86_64 5.6.39-2.el6 mysql56-community 308 k
mysql-community-libs x86_64 5.6.39-2.el6 mysql56-community 1.9 M
perl-DBI x86_64 1.609-4.el6 base 705 k

Transaction Summary
================================================================================
Install 5 Package(s)

Total download size: 75 M
Installed size: 337 M
Downloading Packages:
(1/5): mysql-community-client-5.6.39-2.el6.x86_64.rpm | 18 MB 13:18 
(2/5): mysql-community-common-5.6.39-2.el6.x86_64.rpm | 308 kB 00:15 
(3/5): mysql-community-libs-5.6.39-2.el6.x86_64.rpm | 1.9 MB 01:19 
(4/5): mysql-community-server-5.6.39-2.el6.x86_64.rpm | 55 MB 42:12 
(5/5): perl-DBI-1.609-4.el6.x86_64.rpm | 705 kB 00:01 
--------------------------------------------------------------------------------
Total 22 kB/s | 75 MB 57:08 
warning: rpmts_HdrFromFdno: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Retrieving key from file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
Importing GPG key 0x5072E1F5:
Userid : MySQL Release Engineering <mysql-build@oss.oracle.com>
Package: mysql-community-release-el6-5.noarch (installed)
From : file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA256 Signature, key ID c105b9de: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
Importing GPG key 0xC105B9DE:
Userid : CentOS-6 Key (CentOS 6 Official Signing Key) <centos-6-key@centos.org>
Package: centos-release-6-5.el6.centos.11.1.x86_64 (@anaconda-CentOS-201311272149.x86_64/6.5)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
Installing : mysql-community-common-5.6.39-2.el6.x86_64 1/5 
Installing : mysql-community-libs-5.6.39-2.el6.x86_64 2/5 
Installing : mysql-community-client-5.6.39-2.el6.x86_64 3/5 
Installing : perl-DBI-1.609-4.el6.x86_64 4/5 
Installing : mysql-community-server-5.6.39-2.el6.x86_64 5/5 
Verifying : mysql-community-server-5.6.39-2.el6.x86_64 1/5 
Verifying : mysql-community-libs-5.6.39-2.el6.x86_64 2/5 
Verifying : mysql-community-client-5.6.39-2.el6.x86_64 3/5 
Verifying : mysql-community-common-5.6.39-2.el6.x86_64 4/5 
Verifying : perl-DBI-1.609-4.el6.x86_64 5/5

Installed:
mysql-community-server.x86_64 0:5.6.39-2.el6

Dependency Installed:
mysql-community-client.x86_64 0:5.6.39-2.el6 
mysql-community-common.x86_64 0:5.6.39-2.el6 
mysql-community-libs.x86_64 0:5.6.39-2.el6 
perl-DBI.x86_64 0:1.609-4.el6

Complete!

7.查看已安装的数据库版本:
[root@bogon mdata]# yum list installed|grep mysql
mysql-community-client.x86_64
5.6.39-2.el6 @mysql56-community 
mysql-community-common.x86_64
5.6.39-2.el6 @mysql56-community 
mysql-community-libs.x86_64
5.6.39-2.el6 @mysql56-community 
mysql-community-release.noarch
mysql-community-server.x86_64
5.6.39-2.el6 @mysql56-community

8.添加开机启动项:
[root@bogon mdata]# chkconfig --list|grep mysqld
mysqld 0:off 1:off 2:off 3:on 4:on 5:on 6:off
[root@bogon mdata]# chkconfig mysql on
error reading information on service mysql: No such file or directory
[root@bogon mdata]# chkconfig mysqld on

9.启动mysql服务器:
[root@bogon mdata]# service mysqld start
Initializing MySQL database: 2018-04-12 05:38:48 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2018-04-12 05:38:48 0 [Note] Ignoring --secure-file-priv value as server is running with --bootstrap.
2018-04-12 05:38:48 0 [Note] /usr/sbin/mysqld (mysqld 5.6.39) starting as process 18488 ...
2018-04-12 05:38:48 18488 [Note] InnoDB: Using atomics to ref count buffer pool pages
2018-04-12 05:38:48 18488 [Note] InnoDB: The InnoDB memory heap is disabled
2018-04-12 05:38:48 18488 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2018-04-12 05:38:48 18488 [Note] InnoDB: Memory barrier is not used
2018-04-12 05:38:48 18488 [Note] InnoDB: Compressed tables use zlib 1.2.3
2018-04-12 05:38:48 18488 [Note] InnoDB: Using Linux native AIO
2018-04-12 05:38:48 18488 [Note] InnoDB: Using CPU crc32 instructions
2018-04-12 05:38:48 18488 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2018-04-12 05:38:48 18488 [Note] InnoDB: Completed initialization of buffer pool
2018-04-12 05:38:48 18488 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!
2018-04-12 05:38:48 18488 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB
2018-04-12 05:38:48 18488 [Note] InnoDB: Database physically writes the file full: wait...
2018-04-12 05:38:48 18488 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB
2018-04-12 05:38:48 18488 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB
2018-04-12 05:38:49 18488 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
2018-04-12 05:38:49 18488 [Warning] InnoDB: New log files created, LSN=45781
2018-04-12 05:38:49 18488 [Note] InnoDB: Doublewrite buffer not found: creating new
2018-04-12 05:38:49 18488 [Note] InnoDB: Doublewrite buffer created
2018-04-12 05:38:49 18488 [Note] InnoDB: 128 rollback segment(s) are active.
2018-04-12 05:38:49 18488 [Warning] InnoDB: Creating foreign key constraint system tables.
2018-04-12 05:38:49 18488 [Note] InnoDB: Foreign key constraint system tables created
2018-04-12 05:38:49 18488 [Note] InnoDB: Creating tablespace and datafile system tables.
2018-04-12 05:38:49 18488 [Note] InnoDB: Tablespace and datafile system tables created.
2018-04-12 05:38:49 18488 [Note] InnoDB: Waiting for purge to start
2018-04-12 05:38:49 18488 [Note] InnoDB: 5.6.39 started; log sequence number 0
2018-04-12 05:38:49 18488 [Note] Binlog end
2018-04-12 05:38:49 18488 [Note] InnoDB: FTS optimize thread exiting.
2018-04-12 05:38:49 18488 [Note] InnoDB: Starting shutdown...
2018-04-12 05:38:51 18488 [Note] InnoDB: Shutdown completed; log sequence number 1625977

2018-04-12 05:38:51 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2018-04-12 05:38:51 0 [Note] Ignoring --secure-file-priv value as server is running with --bootstrap.
2018-04-12 05:38:51 0 [Note] /usr/sbin/mysqld (mysqld 5.6.39) starting as process 18510 ...
2018-04-12 05:38:51 18510 [Note] InnoDB: Using atomics to ref count buffer pool pages
2018-04-12 05:38:51 18510 [Note] InnoDB: The InnoDB memory heap is disabled
2018-04-12 05:38:51 18510 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2018-04-12 05:38:51 18510 [Note] InnoDB: Memory barrier is not used
2018-04-12 05:38:51 18510 [Note] InnoDB: Compressed tables use zlib 1.2.3
2018-04-12 05:38:51 18510 [Note] InnoDB: Using Linux native AIO
2018-04-12 05:38:51 18510 [Note] InnoDB: Using CPU crc32 instructions
2018-04-12 05:38:51 18510 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2018-04-12 05:38:51 18510 [Note] InnoDB: Completed initialization of buffer pool
2018-04-12 05:38:51 18510 [Note] InnoDB: Highest supported file format is Barracuda.
2018-04-12 05:38:51 18510 [Note] InnoDB: 128 rollback segment(s) are active.
2018-04-12 05:38:51 18510 [Note] InnoDB: Waiting for purge to start
2018-04-12 05:38:51 18510 [Note] InnoDB: 5.6.39 started; log sequence number 1625977
2018-04-12 05:38:51 18510 [Note] Binlog end
2018-04-12 05:38:51 18510 [Note] InnoDB: FTS optimize thread exiting.
2018-04-12 05:38:51 18510 [Note] InnoDB: Starting shutdown...
2018-04-12 05:38:53 18510 [Note] InnoDB: Shutdown completed; log sequence number 1625987

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 bogon 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 at http://bugs.mysql.com/

The latest information about MySQL is available on the web at

http://www.mysql.com

Support MySQL by buying support/licenses at http://shop.mysql.com

Note: new default config file not created.
Please make sure your config file is current

WARNING: Default config file /etc/my.cnf exists on the system
This file will be read by default by the MySQL server
If you do not want to use this, either remove it, or use the
--defaults-file argument to mysqld_safe when starting the server

[ OK ]
Starting mysqld: [ OK ]

10.mysql数据库安全设置(密码设置):

[root@bogon mdata]# mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!

In order to log into MySQL to secure it, we'll need the current
password for the root user. If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none): 
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.

Set root password? [Y/n] y
New password: 
Re-enter new password: 
Password updated successfully!
Reloading privilege tables..
... Success!

By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] y
... Success!

Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] n
... skipping.

By default, MySQL comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] y
- Dropping test database...
ERROR 1008 (HY000) at line 1: Can't drop database 'test'; database doesn't exist
... Failed! Not critical, keep moving...
- Removing privileges on test database...
... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] y
... Success!

All done! If you've completed all of the above steps, your MySQL
installation should now be secure.

Thanks for using MySQL!

Cleaning up...

11.授权远程登录:
[root@bogon mdata]# mysql -uroot -p密码

mysql> grant all privileges on *.* to 'root'@'%' identified by 'mdata2018' with grant option;
Query OK, 0 rows affected (0.00 sec)

mysql> exit
Bye

12.关闭防火墙:

service iptables stop

CentOS6.5系统,mysql数据库的安装的更多相关文章

  1. [转] Linux学习之CentOS(十三)--CentOS6.4下Mysql数据库的安装与配置

    from:  http://www.cnblogs.com/xiaoluo501395377/archive/2013/04/07/3003278.html 如果要在Linux上做j2ee开发,首先得 ...

  2. Linux学习之CentOS(十三)--CentOS6.4下Mysql数据库的安装与配置

    原文:http://www.cnblogs.com/xiaoluo501395377/archive/2013/04/07/3003278.html 如果要在Linux上做j2ee开发,首先得搭建好j ...

  3. CentOS6.4下Mysql数据库的安装与配置

    原文连接:http://www.cnblogs.com/xiaoluo501395377/archive/2013/04/07/3003278.html 说到数据库,我们大多想到的是关系型数据库,比如 ...

  4. Linux学习之CentOS(十三)--CentOS6.4下Mysql数据库的安装与配置(转)

    原文地址:http://www.cnblogs.com/xiaoluo501395377/archive/2013/04/07/3003278.html 如果要在Linux上做j2ee开发,首先得搭建 ...

  5. Linux学习之CentOS(一)--CentOS6.6下Mysql数据库的安装与配置

    在这里我是通过yum来进行mysql数据库的安装的,通过这种方式进行安装,可以将跟mysql相关的一些服务.jar包都给我们安装好,所以省去了很多不必要的麻烦!!! [root@larry ~]# c ...

  6. Linux CentOS6.4下Mysql数据库的安装与配置

    一.mysql简介 说到数据库,我们大多想到的是关系型数据库,比如mysql.oracle.sqlserver等等,这些数据库软件在windows上安装都非常的方便,在Linux上如果要安装数据库,咱 ...

  7. CentOS6.5下Mysql数据库的安装与配置

    一.mysql简介 说到数据库,我们大多想到的是关系型数据库,比如mysql.oracle.sqlserver等等,这些数据库软件在windows上安装都非常的方便,在Linux上如果要安装数据库,咱 ...

  8. CentOS6.4下Mysql数据库的安装与配置,导入数据库,授权远程ip

    卸载掉原有mysql 由于mysql数据库在Linux上实在是太流行了,所以眼下下载的主流Linux系统版本号基本上都集成了mysql数据库在里面,我们能够通过例如以下命令来查看我们的操作系统上是否已 ...

  9. 00-Windows系统MySQL数据库的安装

    1.数据库安装 官网下载MySQL数据库. 下载安装包后解压缩到相关目录,我解压缩到:D:\360极速浏览器下载\mysql-8.0.19-winx64. 打开刚刚解压的文件夹 D:\360极速浏览器 ...

  10. linux学习之centos(三):mysql数据库的安装和配置

    前言:mysql简介 说到数据库,我们大多想到的是关系型数据库,比如mysql.oracle.sqlserver等等,这些数据库软件在windows上安装都非常的方便,在Linux上如果要安装数据库, ...

随机推荐

  1. 【中间件安全】Jboss安全加固规范

    1. 适用情况 适用于使用Jboss进行部署的Web网站. 适用版本:5.x版本的Jboss服务器 2. 技能要求 熟悉Jboss安装配置,能够Jboss进行部署,并能针对站点使用Jboss进行安全加 ...

  2. Linux i2c子系统(二) _通过i2c-dev.c访问设备的方法

    另外一种驱动 应用层除了使用上述的使用i2c_driver接口来访问i2c设备,Linux内核还提供了一种简单粗暴的方式--直接通过虚拟i2c设备驱动的方式,即上一篇中的i2c-dev提供的方式,这种 ...

  3. C# 网络爬虫利器之Html Agility Pack如何快速实现解析Html

    简介 现在越来越多的场景需要我们使用网络爬虫,抓取相关数据便于我们使用,今天我们要讲的主角Html Agility Pack是在爬取的过程当中,能够高效的解析我们抓取到的html数据. 优势 在.NE ...

  4. django-registration

    快速开始指南 在安装django-registration之前,你需要先安装Django.django-registration 0.8需要Django1.1或更新版本的支持. Django进一步的信 ...

  5. linux 系统全盘备份

    备份程序对比 - Synchronization and backup programs 之前用的 tar进行备份了,更新 grub引导需要重建目录和手动挂载,不是很方便.现直接使用 timeshif ...

  6. less的写法 calc以及变量

    less的文档还是很容易读懂的, 一:结构的嵌套:照着html结构写,目前没有出现错误: 二:变量引用:1,单个变量通常用@变量名 2,多个变量写在一起, 三:calc计算: 目前我觉得最具实用性的就 ...

  7. js中级小知识3

    函数: 函数在调用的时候,会形成一个私有作用域,内部的变量不会被外面访问,这种保护机制叫闭包.这就意味着函数调用完毕,这个函数形成的栈内存会被销毁. 有些时候我们不希望他被销毁. 函数归属谁跟它在哪调 ...

  8. Java应用之POI

    POI的简介 Apache POI是Apache软件基金会的开放源码函式库,POI提供API给Java程序对Microsoft Office格式档案读和写的功能. HSSF的概况 HSSF 是Horr ...

  9. [No0000152]C#基础之IL,轻松读懂IL

    先说说学IL有什么用,有人可能觉得这玩意平常写代码又用不上,学了有个卵用.到底有没有卵用呢,暂且也不说什么学了可以看看一些语法糖的实现,或对.net理解更深一点这些虚头巴脑的东西.其实IL本身逻辑很清 ...

  10. hive on spark配置

    1.安装java.maven.scala.hadoop.mysql.hive 略 2.编译spark ./make-distribution.sh --name "hadoop2-witho ...