您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息
免费发信息
三六零分类信息网 > 林芝分类信息网,免费分类信息发布

CentOS 6.4 安装MySQL 5.6.22

2024/6/20 12:31:48发布88次查看
本文详细介绍在centos 6.4下安装mysql 5.6.22的过程,供需要的朋友学习参考。
本文详细介绍在centos 6.4下安装mysql 5.6.22的过程,供需要的朋友学习参考。
一、下载mysql 安装包
1) 打开网址: select platform: 选择 linux-generic
选择选择 linux - generic (glibc 2.5) (x86, 64-bit), rpm   进行下载;
 linux 下下载: wget
2)下载完后解压缩并放到安装文件夹下:
tar -xf mysql-5.6.22-1.linux_glibc2.5.x86_64.rpm-bundle.tar
mv mysql-5.6.22-1.linux_glibc2.5.x86_64.rpm-bundle /usr/local/software/
mv mysql-5.6.22-1.linux_glibc2.5.x86_64.rpm-bundle mysql
其中里面要使用的是这两个:
mysql数据库: mysql-server-5.6.22-1.linux_glibc2.5.x86_64.rpm
mysql客户端:mysql-client-5.6.22-1.linux_glibc2.5.x86_64.rpm
3)安装环境:cat /etc/redhat-release  
centos release 6.4 (final)
二、mysql安装
1)3)检查安装
在安装mysql之前,先检查centos系统中是否已经安装了一个mysql,如果已经安装先卸载,不然会导致安装新的mysql失败。 
rpm -qa | grep mysql   --查看系统之前是否已安装mysql。 
mysql-libs-5.1.47-4.el6.i686  显示结果说明 centos6.0系统自带了一个mysql,我们需要删除这个老版本,用root用户执行下面语句
su - 
密码:
rpm -e --nodeps mysql-libs-5.1.47-4.el6.i686
先切换到root用户下,然后执行删除语句,删除之后,我们再次查看,发现已经成功删除了centos6.0自带的旧mysql版本。
在删除mysql的rpm后,还要进行一些扫尾操作,网上有两种操作。(备注:我在这里两种都没有用到,发现系统中并没有其他残余的mysql信息。)
第一种善后处理:使用下面命令进行处理。
rm -rf /var/lib/mysql*
rm -rf /usr/share/mysql*
另一种善后处理:卸载后 /var/lib/mysql 中的  /etc/my.cnf 会重命名为 my.cnf.rpmsave,/var/log/mysqld.log 会重命名为 /var/log/mysqld.log.rpmsave,如果确定没用后就手工删除。
2)安装mysql 服务端
rpm -ivh mysql-server-5.6.22-1.linux_glibc2.5.x86_64.rpm 
preparing... ########################################### [100%] 
1:mysql-server ########################################### [100%] 
warning: user mysql does not exist - using root 
warning: group mysql does not exist - using root 
2014-08-10 22:43:44 0 [warning] timestamp with implicit default value is deprecated. please use --explicit_defaults_for_timestamp server option (see documentation for more details). 
2014-08-10 22:43:44 23012 [note] innodb: using atomics to ref count buffer pool pages 
2014-08-10 22:43:44 23012 [note] innodb: the innodb memory heap is disabled 
2014-08-10 22:43:44 23012 [note] innodb: mutexes and rw_locks use gcc atomic builtins 
2014-08-10 22:43:44 23012 [note] innodb: memory barrier is not used 
2014-08-10 22:43:44 23012 [note] innodb: compressed tables use zlib 1.2.3 
2014-08-10 22:43:44 23012 [note] innodb: using linux native aio 
2014-08-10 22:43:44 23012 [note] innodb: not using cpu crc32 instructions 
2014-08-10 22:43:44 23012 [note] innodb: initializing buffer pool, size = 128.0m 
2014-08-10 22:43:44 23012 [note] innodb: completed initialization of buffer pool 
2014-08-10 22:43:45 23012 [note] innodb: the first specified data file ./ibdata1 did not exist: a new database to be created! 
2014-08-10 22:43:45 23012 [note] innodb: setting file ./ibdata1 size to 12 mb 
2014-08-10 22:43:45 23012 [note] innodb: database physically writes the file full: wait... 
2014-08-10 22:43:45 23012 [note] innodb: setting log file ./ib_logfile101 size to 48 mb 
2014-08-10 22:43:46 23012 [note] innodb: setting log file ./ib_logfile1 size to 48 mb 
2014-08-10 22:43:46 23012 [note] innodb: renaming log file ./ib_logfile101 to ./ib_logfile0 
2014-08-10 22:43:46 23012 [warning] innodb: new log files created, lsn=45781 
2014-08-10 22:43:46 23012 [note] innodb: doublewrite buffer not found: creating new 
2014-08-10 22:43:46 23012 [note] innodb: doublewrite buffer created 
2014-08-10 22:43:46 23012 [note] innodb: 128 rollback segment(s) are active. 
2014-08-10 22:43:46 23012 [warning] innodb: creating foreign key constraint system tables. 
2014-08-10 22:43:47 23012 [note] innodb: foreign key constraint system tables created 
2014-08-10 22:43:47 23012 [note] innodb: creating tablespace and datafile system tables. 
2014-08-10 22:43:47 23012 [note] innodb: tablespace and datafile system tables created. 
2014-08-10 22:43:47 23012 [note] innodb: waiting for purge to start 
2014-08-10 22:43:47 23012 [note] innodb: 5.6.22 started; log sequence number 0 
a random root password has been set. you will find it in '/root/.mysql_secret'. 
2014-08-10 22:43:48 23012 [note] binlog end 
2014-08-10 22:43:48 23012 [note] innodb: fts optimize thread exiting. 
2014-08-10 22:43:48 23012 [note] innodb: starting shutdown... 
2014-08-10 22:43:50 23012 [note] innodb: shutdown completed; log sequence number 1625977
2014-08-10 22:43:50 0 [warning] timestamp with implicit default value is deprecated. please use --explicit_defaults_for_timestamp server option (see documentation for more details). 
2014-08-10 22:43:50 23039 [note] innodb: using atomics to ref count buffer pool pages 
2014-08-10 22:43:50 23039 [note] innodb: the innodb memory heap is disabled 
2014-08-10 22:43:50 23039 [note] innodb: mutexes and rw_locks use gcc atomic builtins 
2014-08-10 22:43:50 23039 [note] innodb: memory barrier is not used 
2014-08-10 22:43:50 23039 [note] innodb: compressed tables use zlib 1.2.3 
2014-08-10 22:43:50 23039 [note] innodb: using linux native aio 
2014-08-10 22:43:50 23039 [note] innodb: not using cpu crc32 instructions 
2014-08-10 22:43:50 23039 [note] innodb: initializing buffer pool, size = 128.0m 
2014-08-10 22:43:50 23039 [note] innodb: completed initialization of buffer pool 
2014-08-10 22:43:50 23039 [note] innodb: highest supported file format is barracuda. 
2014-08-10 22:43:50 23039 [note] innodb: 128 rollback segment(s) are active. 
2014-08-10 22:43:50 23039 [note] innodb: waiting for purge to start 
2014-08-10 22:43:50 23039 [note] innodb: 5.6.22 started; log sequence number 1625977 
2014-08-10 22:43:50 23039 [note] binlog end 
2014-08-10 22:43:50 23039 [note] innodb: fts optimize thread exiting. 
2014-08-10 22:43:50 23039 [note] innodb: starting shutdown... 
2014-08-10 22:43:52 23039 [note] innodb: shutdown completed; log sequence number 1625987
a random password has been set for the mysql root user ! 
you will find that password in '/root/.mysql_secret'.
you must change that password on your first connect, 
no other statement but 'set password' will be accepted. 
see the manual for the semantics of the 'password expired' flag.
also, the account for the anonymous user has been removed.
in addition, you can run:
/usr/bin/mysql_secure_installation
which will also give you the option of removing the test database. 
this is strongly recommended for production servers.
see the manual for more instructions.
please report any problems at
the latest information about mysql is available on the web at
support mysql by buying support/licenses at
new default config file was created as /usr/my.cnf and 
will be used by default by the server when you start it. 
you may edit this file to change server settings
3)检测 mysql 3306 端口是否安打开。测试是否成功可运行 netstat 看 mysql 端口是否打开,如打开表示服务已经启动,安装成功。mysql 默认的端口是3306。
[root@hadoop mysql]# netstat -nat  
active internet connections (servers and established) 
proto recv-q send-q local address foreign address state 
tcp 0 0 0.0.0.0:50070 0.0.0.0:* listen 
tcp 0 0 0.0.0.0:22 0.0.0.0:* listen 
tcp 0 0 127.0.0.1:631 0.0.0.0:* listen 
tcp 0 0 127.0.0.1:25 0.0.0.0:* listen 
tcp 0 0 0.0.0.0:50010 0.0.0.0:* listen 
tcp 0 0 0.0.0.0:50075 0.0.0.0:* listen 
tcp 0 0 0.0.0.0:50020 0.0.0.0:* listen 
tcp 0 0 192.168.128.129:9000 0.0.0.0:* listen 
tcp 0 0 0.0.0.0:50090 0.0.0.0:* listen 
tcp 1 0 192.168.128.129:35744 63.130.76.64:80 close_wait 
tcp 0 0 192.168.128.129:34847 192.168.128.129:9000 established 
tcp 0 0 192.168.128.129:35770 192.168.128.129:9000 time_wait 
tcp 0 52 192.168.128.129:22 192.168.128.1:1297 established 
tcp 0 0 192.168.128.129:50968 61.135.185.247:80 established 
tcp 0 0 192.168.128.129:9000 192.168.128.129:34847 established 
tcp 0 0 :::34803 :::* listen 
tcp 0 0 :::22 :::* listen 
tcp 0 0 ::1:631 :::* listen 
tcp 0 0 :::8088 :::* listen 
tcp 0 0 :::13562 :::* listen 
tcp 0 0 :::8030 :::* listen 
tcp 0 0 :::8031 :::* listen 
tcp 0 0 :::8032 :::* listen 
tcp 0 0 :::8033 :::* listen 
tcp 0 0 :::8040 :::* listen 
tcp 0 0 :::8042 :::* listen 
tcp 0 0 ::ffff:192.168.128.129:8031 ::ffff:192.168.128.12:58051 established 
tcp 0 0 ::ffff:192.168.128.12:58051 ::ffff:192.168.128.129:8031 established
4)启动mysql 服务
[root@hadoop mysql]# service mysql start  
starting mysql.......... success!
5) 安装客户端
[root@hadoop mysql]# rpm -ivh mysql-client-5.6.22-1.linux_glibc2.5.x86_64.rpm
preparing...                ########################################### [100%]
1:mysql-client           ^c########################################### [100%]   安装完成
5)mysql的几个重要目录。
林芝分类信息网,免费分类信息发布

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录