zoukankan      html  css  js  c++  java
  • centos7新装mysql 5.7

    官网文档地址

    https://dev.mysql.com/doc/refman/5.7/en/binary-installation.html

    安装必要的包

    shell> yum search libaio # search for info
    shell> yum install libaio # install library

    执行命令
    添加用户时如果用户存在就删除掉

    shell> groupadd mysql
    shell> useradd -r -g mysql -s /bin/false mysql
    shell> cd /usr/local
    shell> tar zxvf /path/to/mysql-VERSION-OS.tar.gz
    shell> ln -s full-path-to-mysql-VERSION-OS mysql
    shell> cd mysql
    shell> mkdir mysql-files
    shell> chown mysql:mysql mysql-files
    shell> chmod 750 mysql-files
    shell> bin/mysqld --initialize --user=mysql 
    shell> bin/mysql_ssl_rsa_setup              
    shell> bin/mysqld_safe --user=mysql &
    # Next command is optional
    shell> cp support-files/mysql.server /etc/init.d/mysql.server
    

    登陆,安装后会生成一个临时的mysql登陆的root密码,注意保存。
    bin/mysql -uroot -p
    密码:

    修改密码
    alter user 'root'@'localhost' identified by '123456';
    问题:
    可能由于先前的用户名的原因,文件夹所有者,进程文件,socket文件等原因,mysql启动不了,注意查看日志。

  • 相关阅读:
    JAVA 练习1
    JSP基础
    网络协议
    mysql基础
    python之高级
    powershell基础
    python之迭代器与遍历
    python之面向对象
    linux常用命令
    docker 安装 ElasticSearch:7.4.2
  • 原文地址:https://www.cnblogs.com/gongpipi/p/9506337.html
Copyright © 2011-2022 走看看