时间:2021-07-01 10:21:17 帮助过:9人阅读
MySQL-5.6.25-1.linux_glibc2.5.i386.rpm-bundle.tar;
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包,如下:
1 |
[root@localhost
rpm] #
ll |
2 |
total
74364 |
3 |
-rw-r--r--.
1 root root 18442536 Dec 11 20:19 MySQL-client-5.6.15-1.el6.x86_64.rpm |
4 |
-rw-r--r--.
1 root root 3340660 Dec 11 20:06 MySQL-devel-5.6.15-1.el6.x86_64.rpm |
5 |
-rw-r--r--.
1 root root 54360600 Dec 11 20:03 MySQL-server-5.6.15-1.el6.x86_64.rpm |
c. 安装MySQL
1 |
[root@localhost
rpm] #
rpm -ivh MySQL-server-5.6.15-1.el6.x86_64.rpm |
2 |
[root@localhost
rpm] #
rpm -ivh MySQL-devel-5.6.15-1.el6.x86_64.rpm |
3 |
[root@localhost
rpm] #
rpm -ivh MySQL-client-5.6.15-1.el6.x86_64.rpm |
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 |
[root@localhost
rpm] #
cat /root/.mysql_secret #查看root账号密码 |
4 |
#
The random password set for the root user at Wed Dec 11 23:32:50 2013 (local time): qKTaFZnl |