您的位置:首页 > 数据库 > MySQL

备忘,mysql5.7.21.zip 安装

2018-03-27 17:01 447 查看
https://www.cnblogs.com/iathanasy/p/8461429.html
大部分参考此链接,感谢作者
Microsoft Windows [版本 10.0.16299.309]
(c) 2017 Microsoft Corporation。保留所有权利。

C:\WINDOWS\system32>mysqld --initialize --user=mysql --console
mysqld: Can't create directory 'C:\WINDOWS\system32\5.7.21-winx64\mysql-5.7.21-winx64\5.7.21-winx64\mysql-5.7.21-winx64\data\' (Errcode: 2 - No such file or directory)
2018-03-27T08:45:37.074606Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2018-03-27T08:45:37.075319Z 0 [ERROR] Can't find error-message file 'C:\WINDOWS\system32\5.7.21-winx64\mysql-5.7.21-winx64\share\errmsg.sys'. Check error-message file location and 'lc-messages-dir' configuration directive.
2018-03-27T08:45:37.078082Z 0 [ERROR] Aborting

C:\WINDOWS\system32>mysqld --initialize --user=mysql --console
2018-03-27T08:46:58.346546Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2018-03-27T08:46:58.732169Z 0 [Warning] InnoDB: New log files created, LSN=45790
2018-03-27T08:46:58.818093Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2018-03-27T08:46:58.883764Z 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: 6929c399-319b-11e8-b3bb-086266300787.
2018-03-27T08:46:58.890245Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2018-03-27T08:46:58.900780Z 1 [Note] A temporary password is generated for root@localhost: u2Pvie+OjRx*

C:\WINDOWS\system32>

C:\WINDOWS\system32>

C:\WINDOWS\system32>cd D:\mysql-5.7.21-winx64\mysql-5.7.21-winx64\bin

C:\WINDOWS\system32>D:

D:\mysql-5.7.21-winx64\mysql-5.7.21-winx64\bin>mysqld --install
The service already exists!
The current server installed: "D:\Program Files\MySQL\MySQL Server 5.6\bin\mysqld" Mysql

D:\mysql-5.7.21-winx64\mysql-5.7.21-winx64\bin>mysqld --install mysql5.7.21
Service successfully installed.

D:\mysql-5.7.21-winx64\mysql-5.7.21-winx64\bin>net start mysql5.7.21
mysql5.7.21 服务正在启动 .
mysql5.7.21 服务已经启动成功。

D:\mysql-5.7.21-winx64\mysql-5.7.21-winx64\bin>mysql -uroot -p
Enter password: ************
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

D:\mysql-5.7.21-winx64\mysql-5.7.21-winx64\bin>mysql -P 3326 -uroot
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

D:\mysql-5.7.21-winx64\mysql-5.7.21-winx64\bin>mysql --port 3326 -uroot -p
Enter password: ************
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.21

Copyright (c) 2000, 2018, 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 version();
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
mysql> set password for root@localhost=password('XY_CK_3326');
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> quit;
Bye

D:\mysql-5.7.21-winx64\mysql-5.7.21-winx64\bin>mysql --port 3326 -uroot -p
Enter password: **********
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

D:\mysql-5.7.21-winx64\mysql-5.7.21-winx64\bin>mysql --port 3326 -uroot -p
Enter password: **********
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.7.21 MySQL Community Server (GPL)

Copyright (c) 2000, 2018, 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 VERSION();
+-----------+
| VERSION() |
+-----------+
| 5.7.21    |
+-----------+
1 row in set (0.00 sec)

mysql>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: