zoukankan      html  css  js  c++  java
  • CentOS6.5安装mysql-5.7.18-1.el6.x86_64.rpm-bundle.tar

    本文内容为转载内容,具体作者忘记是谁了,在收藏夹找到的

      先去官网(https://dev.mysql.com/downloads/mysql/),在Select Operating System选择Red Hat Enterprise Linux / Oracle Linux,在Select OS Version选择Red Hat Enterprise Linux 6 / Oracle Linux 6 (x86, 64-bit),下载RPM Bundle 
            将下载的文件上传到服务器/usr/local下,接着执行如下命令

    rpm -qa|grep mysql #查看mysql是否安装,如果已经安装需要卸载,如果是
    yum -y remove mysql-libs-5.1.71-1.el6.x86_64 
     #卸载
    cd /usr/local/ #指定目录
    tar -xvf mysql-5.7.18-1.el6.x86_64.rpm-bundle.tar
     #解压
    rpm -ivh mysql-community-common-5.7.18-1.el6.x86_64.rpm
    rpm -ivh mysql-community-libs-5.7.18-1.el6.x86_64.rpm
    rpm -ivh mysql-community-client-5.7.18-1.el6.x86_64.rpm
    yum install perl #安装server时需要的依赖包
    yum install numactl #安装server时需要的依赖包
    yum install libaio #安装时需要的依赖包
    rpm -ivh mysql-community-server-5.7.18-1.el6.x86_64.rpm
    service mysqld start #启动mysqld服务
    netstat -tlunp #查看服务所需端口
    cat /var/log/mysqld.log | more #查看日志,找初始密码
    cat /etc/issue #查看系统版本
    getconf LONG_BIT #查看系统位数
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18

    如下所示

    2017-06-16T04:48:19.788616Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
    2017-06-16T04:48:22.099994Z 0 [Warning] InnoDB: New log files created, LSN=45790
    2017-06-16T04:48:22.332387Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
    2017-06-16T04:48:22.405922Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 068f9e70-524f-11e7-80fb-000c297c9986.
    2017-06-16T04:48:22.409115Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
    2017-06-16T04:48:22.410417Z 1 [Note] A temporary password is generated for root@localhost: dee5h,lqSA>)
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7

    接着执行如下命令

    mysql -uroot -pdee5h,lqSA>)
    alter user 'root'@'localhost' identified by 'Mysql@123456'; #设置root的密码为Mysql@123456
    use mysql;
    update user set user.Host='%' where user.User='root';
    flush privileges;
    exit;
    /sbin/iptables -I INPUT -p tcp --dport 3306 -j ACCEPT #配置端口3306
    /etc/rc.d/init.d/iptables save #保存配置
    /etc/init.d/iptables restart #重启防火墙iptables
  • 相关阅读:
    破衣服的回忆
    underscorejs 源码走读笔记
    关于书籍《区块链以太坊DApp开发实战》的内容告示
    从区块链技术研发者的角度,说说我的区块链从业经历和对它的理解
    简介 以太坊 2.0 核心 之 共识机制的改变
    一般电商应用的订单队列架构思想
    详细讲解:零知识证明 之 ZCash 完整的匿名交易流程
    HyperLogLog 算法的原理讲解以及 Redis 是如何应用它的
    由 System.arraycopy 引发的巩固:对象引用 与 对象 的区别
    如何独立开发一个网络请求框架
  • 原文地址:https://www.cnblogs.com/renhongwei/p/9242962.html
Copyright © 2011-2022 走看看