• mysql5.6和5.7安装 centos


    mysql5.7安装

    tar xf mysql-5.7.17-linux-glibc2.5-x86_64.tar.gz
    
    mv mysql-5.7.17-linux-glibc2.5-x86_64 /opt/mysql
    
    yum install -y compat-libstdc++-33 libaio libaio-devel
    
    useradd -M -s /sbin/nologin mysql
    
    mkdir -p /home/mysql/3306/{data,logs,binlog}
    
    chown -R mysql:mysql  /home/mysql
    
    cd /opt/mysql
    
    ./bin/mysqld --defaults-file=/opt/mysql/conf/my3306.cnf --initialize --user=mysql --basedir=/opt/mysql --datadir=/home/mysql/3306/data
    #/opt/mysql/conf/my3306.cnf 链接:http://www.cnblogs.com/hanxiaohui/p/8669980.html
    #修改/opt/mysql/bin/mysqld_safe  :1,$s@usr/local@opt@g
    
    /opt/mysql/scripts/my3306.sh start
    #脚本链接:http://www.cnblogs.com/hanxiaohui/p/8399191.html
    
    登陆修改密码
    #skip-grant-tables  重启
    update mysql.user set authentication_string=password('123456') where user='root';
    flush privileges;
    
    初次登陆后需要执行:
        SET PASSWORD = PASSWORD('123456');这句话重新设置一次密码,不然什么都操作不了!大爷的,真费劲啊。

    mysql5.6安装

    tar xf mysql-5.6.33-linux-glibc2.5-x86_64.tar.gz
    
    mv mysql-5.6.33-linux-glibc2.5-x86_64 /opt/mysql
    
    yum install -y compat-libstdc++-33 libaio libaio-devel
    
    useradd -M -s /sbin/nologin mysql
    
    mkdir -p /home/mysql/3306/{data,logs,binlog}
    
    chown -R mysql:mysql  /home/mysql
    
    cd /opt/mysql
    
    ./scripts/mysql_install_db --user=mysql --datadir=/home/mysql/3306/data
    #/opt/mysql/conf/my3306.cnf 链接:http://www.cnblogs.com/hanxiaohui/p/8399161.html
    #修改/opt/mysql/bin/mysqld_safe  :1,$s@usr/local@opt@g
    
    /opt/mysql/scripts/my3306.sh start
    #脚本链接:http://www.cnblogs.com/hanxiaohui/p/8399191.html
    
    登陆修改密码
    装好是没有密码的
    update mysql.user set password=password('123456') where user='root';
    flush privileges;
    
    
    授权
    grant all on *.* to 'root'@'%' identified by '123456';
    flush privileges;
  • 相关阅读:
    webpack管理资源
    webpack缓存
    webpack起步
    openssl命令使用
    linux系统安装中文字体-----
    HTML转成PDF的4个前端方法----但都被我拒绝了,我选择后端方法(这才是吊!)
    HTML页面如何导出pdf
    为什么装了easyless插件,vscode还是不能用?
    JSON格式错误,json_decode中true和JSON_UNESCAPED_SLASHES的用法
    tp5条件判断,in,notin,between,if等
  • 原文地址:https://www.cnblogs.com/hanxiaohui/p/8671762.html
Copyright © 2020-2023  润新知