1. 程式人生 > >mysql5.7.20安裝全解

mysql5.7.20安裝全解

C:\Windows\system32>mysqld --initialize --console
2018-01-12T09:36:54.704083Z 0 [Warning] InnoDB: New log files created, LSN=45790
2018-01-12T09:36:55.177153Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2018-01-12T09:36:55.386758Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 20a64d7d-f77c-11e7-98e2-3c970efb98fa.
2018-01-12T09:36:55.437302Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2018-01-12T09:36:55.453322Z 1 [Note] A temporary password is generated for
[email protected]
: uPspiji6tT/j


C:\Windows\system32>net start mysql
MySQL 服務正在啟動 .
MySQL 服務已經啟動成功。




C:\Windows\system32>net stop mysql
MySQL 服務正在停止.
MySQL 服務已成功停止。




C:\Windows\system32>mysql
ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost' (10061)


C:\Windows\system32>net start mysql
MySQL 服務正在啟動 .
MySQL 服務已經啟動成功。




C:\Windows\system32>mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.20 MySQL Community Server (GPL)


Copyright (c) 2000, 2017, 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> use mysql
Database changed
mysql> quit
Bye


C:\Windows\system32>mysql -uroot -p
Enter password: ************
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.7.20 MySQL Community Server (GPL)


Copyright (c) 2000, 2017, 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> set password for
[email protected]
= password('123456');
ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement
mysql>
mysql>
mysql>
mysql> flush privileges
    -> ;
Query OK, 0 rows affected (0.01 sec)


mysql> ^C
mysql>  set password for
[email protected]
= password('123456');
Query OK, 0 rows affected, 1 warning (0.00 sec)


mysql> quit

Bye

開始參考https://www.cnblogs.com/scofield-yang/p/8010829.html