zoukankan      html  css  js  c++  java
  • centos中 mysql 5.7安装

     以免授权模式启动

    编辑 /etc/my.cnf,添加以下内容:

     linux环境中:vi /etc/my.cnf

    在[MySQL(和PHP搭配之最佳组合)d]配置段添加如下两行:

    user=mysql

    skip-grant-tables

    保存退出编辑。

    重新启动 mysqld.

    service mysqld restart

    使用 mysql免密码连接,修改密码和密码过期标志;

    [root@iZm5ei4m ~]# mysql
    Welcome to the MySQL monitor.  Commands end with ; or g.
    Your MySQL connection id is 3
    Server version: 5.7.16 MySQL Community Server (GPL)
    
    Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
    
    Oracle is a registered trademark of Oracle Corporation and/or its
    affiliates. Other names may be trademarks of their respective
    owners.
    
    Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
    
    mysql> select user();
    
    mysql> show databases;
    +--------------------+
    | Database           |
    +--------------------+
    | information_schema |
    | mysql              |
    | performance_schema |
    | sys                |
    +--------------------+
    4 rows in set (0.00 sec)
    
    mysql> select user();
    +--------+
    | user() |
    +--------+
    | root@  |
    +--------+
    1 row in set (0.00 sec)
    
    mysql>UPDATE mysql.user SET authentication_string=PASSWORD('wajuejishu@34!'),password_expired='N' where USER='root';
    Query OK, 1 rows affected, 0 warning (0.00 sec)
    mysql> exit
    Bye
    

    正常连接:

    [root@iZm5ei4mxt5qb65ldoxpywZ ~]# mysql -u root -p
    Enter password:
    Welcome to the MySQL monitor.  Commands end with ; or g.
    Your MySQL connection id is 3
    Server version: 5.7.16 MySQL Community Server (GPL)
    
    Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
    
    Oracle is a registered trademark of Oracle Corporation and/or its
    affiliates. Other names may be trademarks of their respective
    owners.
    
    Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
    
    mysql>
    

      

  • 相关阅读:
    Linux文件系统结构
    JAVA实现上传下载共享文件
    JAVA 实现通过URL下载文件到本地库
    使用SoapUI 测试 Web Service
    DB2存储过程实现查询表数据,生成动态SQL,并执行
    DB2查看表空间大小及使用情况
    Spring使用总结
    Commons-logging + Log4j
    JAVA生成EXCEL图表
    html5离线缓存原理
  • 原文地址:https://www.cnblogs.com/diylab/p/6065133.html
Copyright © 2011-2022 走看看