mysql的安裝 一、yum源格式安裝mysql 1、到官網下載mysql的yum源: [root@localhost Downloads]# wget http://dev.mysql.com/get/mysql57-community-release-el6-7.noarch.rpm [root
mysql的安裝
一、yum源格式安裝mysql
1、到官網下載mysql的yum源:
[root@localhost Downloads]# wget http://dev.mysql.com/get/mysql57-community-release-el6-7.noarch.rpm
[root@localhost Downloads]# ls
mysql57-community-release-el6-7.noarch.rpm
2、列出rpm包中文件(查看哪些內容):
[root@localhost Downloads]# rpm -qpl mysql57-community-release-el6-7.noarch.rpm
warning: mysql57-community-release-el6-7.noarch.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
/etc/pki/rpm-gpg/RPM-GPG-KEY-mysql
/etc/yum.repos.d/mysql-community-source.repo
/etc/yum.repos.d/mysql-community.repo
3、安裝rpm包(自動配置好yum源):
[root@localhost Downloads]# rpm -ivh mysql57-community-release-el6-7.noarch.rpm
warning: mysql57-community-release-el6-7.noarch.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing... ########################################### [100%]
1:mysql57-community-relea########################################### [100%]
4、安裝mysql:
[root@localhost Downloads]# yum install mysql
5、啟動mysql:
[root@localhost mysql]# /etc/init.d/mysql start
Starting MySQL........ [ OK ]
二、RPM方式安裝mysql:
1.將下載好的文件上傳到Linux下:
[root@localhost Downloads]# ls
MySQL-5.6.16-1.el6.x86_64.rpm-bundle.tar
2、解壓tar文件:
[root@localhost Downloads]# tar -xf MySQL-5.6.16-1.el6.x86_64.rpm-bundle.tar
[root@localhost Downloads]# ls
MySQL-client-5.6.16-1.el6.x86_64.rpm
MySQL-devel-5.6.16-1.el6.x86_64.rpm
MySQL-embedded-5.6.16-1.el6.x86_64.rpm
MySQL-server-5.6.16-1.el6.x86_64.rpm
MySQL-shared-5.6.16-1.el6.x86_64.rpm
MySQL-shared-compat-5.6.16-1.el6.x86_64.rpm
MySQL-test-5.6.16-1.el6.x86_64.rpm
3、安裝rpm文件:
[root@localhost Downloads]# rpm -Uvh MySQL-*
Preparing... ########################################### [100%]
1:MySQL-devel ########################################### [ 14%]
2:MySQL-client ########################################### [ 29%]
3:MySQL-test ########################################### [ 43%]
4:MySQL-embedded ########################################### [ 57%]
5:MySQL-shared-compat ########################################### [ 71%]
6:MySQL-shared ########################################### [ 86%]
7:MySQL-server ########################################### [100%]
4、啟動mysql服務:
[root@localhost mysql]# /etc/init.d/mysql start
Starting MySQL........ [ OK ]