RPM方式安装MySQL5.6.30 a. 检查 MySQL 及相关 RPM 包,是否安装,如果有安装,则移除( rpm–e名称) 1 [root@localhost ~] # rpm -qa | grep -i mysql 2 mysql-libs-5.1.66-2.el6_3.x86_64 3 [root@localhost ~] # yum -y remove mysql-libs* b. 下载Linux
RPM方式安装MySQL5.6.30a. 检查MySQL及相关RPM包,是否安装,如果有安装,则移除(rpm –e 名称)
1
|
[root@localhost
~] #
rpm -qa | grep -i mysql
|
2
|
mysql-libs-5.1.66-2.el6_3.x86_64
|
3
|
[root@localhost
~] #
yum -y remove mysql-libs*
|
b. 下载Linux对应的RPM包,如:CentOS6.6_64对应的RPM包,如下:
1
|
[root@localhost
rpm] #
ll
|
2
|
total
74364
|
3
|
-rw-r--r--.
1 root root 18442536 Dec 11 16:43 MySQL-client-5.6.30-1.linux_glibc2.5.x86_64.rpm
|
4
|
-rw-r--r--.
1 root root 3340660 Dec 11 <span style="font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace; font-size:14px; line-height:15.4px">
16:43</span> MySQL-devel-<span style="font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace; font-size:14px; line-height:15.4px">5.6.30-1.linux_glibc2.5.x86<span style="font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace; font-size:14px; line-height:15.4px">_64</span></span>.rpm
|
5
|
-rw-r--r--.
1 root root 54360600 Dec 11 <span style="font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace; font-size:14px; line-height:15.4px">
16:43</span> MySQL-server-<span style="font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace; font-size:14px; line-height:15.4px">5.6.30-1.linux_glibc2.5.x86<span style="font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace; font-size:14px; line-height:15.4px">_64</span></span>.rpm
|
c. 安装MySQL
1
|
[root@localhost
rpm] #
rpm -ivh MySQL-server-5.6.30-1.linux_glibc2.5.x86_64.rpm
|
2
|
[root@localhost
rpm] #
rpm -ivh <span style="font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace; font-size:14px; line-height:15.4px; background-color:rgb(248,248,248)">
MySQL-devel-</span><span style="font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace; font-size:14px; line-height:15.4px; background-color:rgb(248,248,248)">5.6.30-1.linux_glibc2.5.x86<span style="line-height:15.4px">_64</span></span><span style="font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace; font-size:14px; line-height:15.4px; background-color:rgb(248,248,248)">.rpm</span>
|
3
|
[root@localhost
rpm] #
rpm -ivh <span style="color:rgb(51,51,51); font-family:Consolas,'Bitstream Vera Sans Mono','Courier New',Courier,monospace; font-size:14px; line-height:15.4px">
MySQL-client-5.6.30-1.linux_glibc2.5.x86_64.rpm</span>
|
4
|
#修改配置文件位置
|
5
|
[root@localhost
rpm] #
cp /usr/share/mysql/my-default.cnf /etc/my.cnf
|
d. 初始化MySQL及设置密码
1
|
[root@localhost
rpm] #
/usr/bin/mysql_install_db
|
2
|
[root@localhost
rpm] #
service mysql start
|
3
|
|