1、查看是否安装过MySQL
#rpm -qa | grep mysql2、卸载MySQL
如果安装过低版本的MySQL,可以卸载已安装的MySQL#rpm -e --nodeps mysql-libs-5.1.61-4.el6.x86_64
要将 /var/lib/mysql文件夹下的所有文件都删除干净
3、下载安装包
这里通过rpm安装包安装MySQL。首先下载CommunityServer 版的。 Community Server下载地址:http://www.mysql.com/downloads/mysql/。
4、安装说明
MySQL的安装包有很多个,作用也不同,在大多数情况下,只需要安装MySQL-server 和 MySQL-client,其他的包根据需要来安装。如果需要php支持mysql需要安装MySQL-shared-5.6.26-1.linux_glibc2.5.i386.rpm
把上面的压缩包解压后可以看到如下目录:
5、安装mysql服务器
[root@chenchen softwares]# rpm -ivh MySQL-server-5.6.26-1.linux_glibc2.5.i386.rpm
warning:MySQL-server-5.6.26-1.linux_glibc2.5.i386.rpm: Header V3 DSA signature: NOKEY,key ID 5072e1f5
Preparing... ###########################################[100%]
1:MySQL-server ########################################### [100%]
2015-09-03 09:58:28 0 [Warning] TIMESTAMPwith implicit DEFAULT value is deprecated. Please use--explicit_defaults_for_timestamp server option (see documentation for moredetails).
2015-09-03 09:58:28 0 [Note]/usr/sbin/mysqld (mysqld 5.6.26) starting as process 2883 ...
2015-09-03 09:58:28 2883 [Note] InnoDB:Using mutexes to ref count buffer pool pages
2015-09-03 09:58:28 2883 [Note] InnoDB: TheInnoDB memory heap is disabled
2015-09-03 09:58:28 2883 [Note] InnoDB:Mutexes and rw_locks use InnoDB's own implementation
2015-09-03 09:58:28 2883 [Note] InnoDB:Memory barrier is not used
2015-09-03 09:58:28 2883 [Note] InnoDB:Compressed tables use zlib 1.2.3
2015-09-03 09:58:28 2883 [Note] InnoDB:Using Linux native AIO
2015-09-03 09:58:28 2883 [Note] InnoDB: Notusing CPU crc32 instructions
2015-09-03 09:58:29 2883 [Note] InnoDB:Initializing buffer pool, size = 128.0M
2015-09-03 09:58:30 2883 [Note] InnoDB:Completed initialization of buffer pool
2015-09-03 09:58:30 2883 [Note] InnoDB: Thefirst specified