CentOS6.x下yum安裝MySQL5.5/5.6

1. 安裝mysql-5.5的yum源php

# rpm -ivh http://repo.mysql.com/yum/mysql-5.5-community/el/6/x86_64/mysql-community-release-el6-5.noarch.rpm

安裝MySQL5.6的能夠安裝:mysql

# rpm -ivh http://repo.mysql.com/mysql-community-release-el6.rpm

最新的yum源能夠去http://dev.mysql.com/downloads/repo/yum下載sql

2. 修改安裝好的yum源數據庫

編輯 /etc/yum.repos.d/mysql-community.repo文件,將5.5的enabled改成1;5.6的enabled改成0vim

[root@localhost yum.repos.d]# vim mysql-community.repo
# Enable to use MySQL 5.5
[mysql55-community]
name=MySQL 5.5 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.5-community/el/6/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

# Enable to use MySQL 5.6
[mysql56-community]
name=MySQL 5.6 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.6-community/el/6/$basearch/
enabled=0
gpgcheck=1
gpgkey=file:/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

3.安裝mysql-5.5url

#  yum -y install mysql-community-client mysql-community-devel mysql-community-server php-mysql

4. 調整配置操作系統

[root@localhost yum.repos.d]# vim /etc/my.cnf
#在[mysqld]下添加 innodb_file_per_table=1 設置InnoDB爲獨立表空間模式,每一個數據庫的每一個表都會生成一個數據目錄 innodb_buffer_pool_size= 默認值:128M,設置爲操做系統內存的70%-80%最佳

 5. 啓動mysql,查看mysql版本server

[root@localhost yum.repos.d]# service mysqld start
Starting mysqld: [ OK ]
[root@localhost yum.repos.d]# mysql --version
mysql Ver 14.14 Distrib 5.5.58, for Linux (x86_64) using readline 5.1
相關文章
相關標籤/搜索