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. OpenGL step by step 38 : Skeletal Animation with Assimp

    一般骨架模型由两部分组成: Rigging(bone):相当于骨架,可以用来控制模型的动作 Mesh(skin):相当于表面皮肤 骨架模型一般是层级结构的,比如上面 背骨是root,他的孩子包括胳膊. ...

  2. 将VSCode添加到右键

    https://www.cnblogs.com/Rexcnblog/p/8046371.html https://www.jianshu.com/p/b49002fa10a7 @echo Off :S ...

  3. Golang 的 协程调度机制 与 GOMAXPROCS 性能调优

    作者:林冠宏 / 指尖下的幽灵 掘金:https://juejin.im/user/587f0dfe128fe100570ce2d8 博客:http://www.cnblogs.com/linguan ...

  4. UIWebView使用app内自定义字体

    最近,做了个小需求.因为app是使用的自定义字体,所以产品想让h5的字体跟app的字体一致,减少脱离感.而一般来说,app内的h5页面,都是显示系统的默认字体.要想使用自定义字体,一般的做法是在h5里 ...

  5. I - All X

    F(x,m) 代表一个全是由数字x组成的m位数字.请计算,以下式子是否成立: F(x,m) mod k ≡ c Input 第一行一个整数T,表示T组数据. 每组测试数据占一行,包含四个数字x,m,k ...

  6. 阿里天池的新任务(简单)(KMP统计子串出现的次数)

    阿里“天池”竞赛平台近日推出了一个新的挑战任务:对于给定的一串 DNA 碱基序列 tt,判断它在另一个根据规则生成的 DNA 碱基序列 ss 中出现了多少次. 输出格式 输出一个整数,为 tt 在 s ...

  7. CString数组和CStringArray

    CStringArray是编译器定义的类型!可以进行一些(如:访问.增.删.改)等操作. 集中单个字符串的操作使用Cstring,集中一批字符串的管理使用CstringArray. 一个是动态,CSt ...

  8. 剑指offer——python【第15题】反转链表

    题目描述 翻转一个链表 样例:给出一个链表1->2->3->null,这个翻转后的链表为3->2->1->null 思路 一种比较简单的方法是用“摘除法”.就是先新 ...

  9. 再次重温《Right here waiting》

    记得高中时候听到这首曲子(当时还让同桌帮我抄了这首曲子,后来这个本子也不知道扔到哪里去了), 前天偶尔在虾米遇到这首曲子,过去的青涩岁月历历在目,自己手动打打歌词,一方面是为了重温这首曲子,另一方面, ...

  10. Oracle工具——ADRCI

    ADRCI工具是Oracle11g才推出的新工具,主要用来管理alert文件.trace文件.dump文件.健康监事报告等. 这一篇简单介绍ADRCI工具. 用过11g的人都会发现,11g中alert ...