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>
    

      

  • 相关阅读:
    HDU5779 Tower Defence
    Python练习题2.14求整数段和
    Python练习题2.13分段计算居民水费
    Python练习题2.12输出三角形面积和周长
    Python练习题2.11求平方与倒数序列的部分和
    Python练习题2.9比较大小
    Python练习题2.8转换函数使用
    Python练习题2.7产生每位数字相同的n位数
    Python练习题2.6求交错序列前N项和
    Python练习题2.5求奇数分之一序列前N项和(存在问题)
  • 原文地址:https://www.cnblogs.com/diylab/p/6065133.html
Copyright © 2011-2022 走看看