zoukankan      html  css  js  c++  java
  • mysql8.0 初始化数据库及表名大小写问题

    删除DATA文件夹

    rm -rf /var/lib/mysql

    重新初始化并启动MYSQL

    mysqld --initialize --console --lower-case-table-names=1
    chown -R mysql:mysql /var/lib/mysql/
    systemctl start mysqld
    systemctl status mysqld
    

    重新初始化登录帐户

    vim /etc/my.cnf.d
    --增加
    skip-grant-tables
    --退出后重启
    systemctl stop mysqld
    systemctl start mysqld
    --开始重置密码
    mysql -uroot -p --输入任意密码
    --必须先执行 flush privileges,否则会报The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement
    flush privileges;
    ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'tw369.com';
    UPDATE USER SET host ="%" where user = "root"; 
    flush privileges;
    exit
    

    启动服务

    删除配置文件的 skip-grant-tables

    systemctl restart mysqld

  • 相关阅读:
    socketserver
    socket进阶
    socket基础
    反射
    subprocess模块
    面向对象高级特性
    面向对象基础
    字典的高级特性
    *号的妙用
    logging模块
  • 原文地址:https://www.cnblogs.com/littlewrong/p/14677993.html
Copyright © 2011-2022 走看看