centos中 mysql 5.7安裝

來源:互聯網
上載者:User

標籤:sys   密碼串連   font   inf   reg   mysqld   模式   blog   cti   

 以免授權模式啟動

編輯 /etc/my.cnf,添加以下內容:

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

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

user=mysql

skip-grant-tables

儲存退出編輯。

重新啟動 mysqld.

service mysqld restart

使用 mysql免密碼串連,修改密碼和密碼到期標誌;

[[email protected] ~]# mysqlWelcome to the MySQL monitor.  Commands end with ; or \g.Your MySQL connection id is 3Server 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 itsaffiliates. Other names may be trademarks of their respectiveowners.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() |+--------+| [email protected]  |+--------+1 row in set (0.00 sec)mysql>UPDATE mysql.user SET authentication_string=PASSWORD(‘[email protected]!‘),password_expired=‘N‘ where USER=‘root‘;Query OK, 1 rows affected, 0 warning (0.00 sec)mysql> exitBye

正常串連:

[[email protected] ~]# mysql -u root -pEnter password:Welcome to the MySQL monitor.  Commands end with ; or \g.Your MySQL connection id is 3Server 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 itsaffiliates. Other names may be trademarks of their respectiveowners.Type ‘help;‘ or ‘\h‘ for help. Type ‘\c‘ to clear the current input statement.mysql>

  

centos中 mysql 5.7安裝

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.