首页 > 数据库 > MySQL > 正文

R1-003 MySQL的rpm安装案例

2024-07-24 12:31:21
字体:
来源:转载
供稿:网友
        R1-003 MySQL的rpm安装实例:

1、解压tar包
     [root@hhu MySQL]# tar -xvf mysql-5.7.17-1.el6.x86_64.rpm-bundle.tar
     mysql-community-test-5.7.17-1.el6.x86_64.rpm
     mysql-community-embedded-5.7.17-1.el6.x86_64.rpm
    mysql-community-embedded-devel-5.7.17-1.el6.x86_64.rpm
    mysql-community-server-5.7.17-1.el6.x86_64.rpm
   mysql-community-libs-compat-5.7.17-1.el6.x86_64.rpm
   mysql-community-devel-5.7.17-1.el6.x86_64.rpm
 
2、卸载已有老版本MySQL
[root@hhu MySQL]# rpm -qa|grep mysql
mysql-5.1.71-1.el6.x86_64
mysql-devel-5.1.71-1.el6.x86_64
mysql-libs-5.1.71-1.el6.x86_64
[root@hhu MySQL]# rpm -e mysql-5.1.71-1.el6.x86_64
error: Failed dependencies:
mysql = 5.1.71-1.el6 is needed by (installed) mysql-devel-5.1.71-1.el6.x86_64
[root@hhu MySQL]# rpm -e mysql-devel-5.1.71-
[root@hhu MySQL]# rpm -qa|grep mysql
 
3、安装MySQL包,一共5个,会有依赖关系,安装顺序如下:
rpm -Uvh mysql-community-common-5.7.17-1.el6.x86_64.rpm
rpm -Uvh mysql-community-libs-5.7.17-1.el6.x86_64.rpm
rpm -Uvh mysql-community-libs-compat-5.7.17-1.el6.x86_64.rpm
rpm -Uvh mysql-community-client-5.7.17-1.el6.x86_64.rpm
rpm -Uvh mysql-community-server-5.7.17-1.el6.x86_64.rpm
[root@hhu MySQL]# ls
mysql-5.7.17-1.el6.x86_64.rpm-bundle.tar mysql-community-embedded-devel-5.7.17-1.el6.x86_64.rpm
mysql-community-client-5.7.17-1.el6.x86_64.rpm mysql-community-libs-5.7.17-1.el6.x86_64.rpm
mysql-community-common-5.7.17-1.el6.x86_64.rpm mysql-community-libs-compat-5.7.17-1.el6.x86_64.rpm
mysql-community-devel-5.7.17-1.el6.x86_64.rpm mysql-community-server-5.7.17-1.el6.x86_64.rpm
mysql-community-embedded-5.7.17-1.el6.x86_64.rpm mysql-community-test-5.7.17-1.el6.x86_64.rpm
[root@hhu MySQL]# rpm -Uvh mysql-community-common-5.7.17-1.el6.x86_64.rpm
warning: mysql-community-common-5.7.17-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
 
4、获取超级数据库用户临时密码,登录,修改密码
[root@hhu MySQL]# grep 'temporary password' /var/log/mysqld.log
2017-02-23T01:36:39.249352Z 1 [Note] A temporary password is generated for root@localhost: i7NmqxstDZ?L
[root@hhu MySQL]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or /g.
Your MySQL connection id is 4
Server version: 5.7.17
 
mysql> quit
Bye

(编辑:武林网)

上一篇:MySQL unsigned性能

下一篇:mysqldump输出

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表