暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

Windows下安装Mysql-5.7.38-winx64

云自由 2022-09-16
409

一、新建my.ini

[client]
default-character-set=utf8

[mysqld]
#端口号
port = 3306
#mysql-5.7.38-winx64的路径
basedir=D:\mysql-5.7.38-winx64
#mysql-5.7.38-winx64的路径+\data
datadir=D:\mysql-5.7.38-winx64\data
#最大连接数
max_connections=200
#编码
character-set-server=utf8

default-storage-engine=INNODB

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

[mysql]
#编码
default-character-set=utf8  
复制

二、安装过程全记录,不做解释。

C:\Windows\system32>d:

D:\>cd mysql-5.7.38-winx64

D:\mysql-5.7.38-winx64>cd bin

D:\mysql-5.7.38-winx64\bin>mysqld --install
The service already exists!
The current server installed: D:\mysql-5.7.23-winx64\bin\mysqld MySQL

D:\mysql-5.7.38-winx64\bin>mysqld --remove
Service successfully removed.

D:\mysql-5.7.38-winx64\bin>mysqld --install
Service successfully installed.

D:\mysql-5.7.38-winx64\bin>mysqld --initialize --console
2022-09-16T12:13:20.103850Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2022-09-16T12:13:20.104738Z 0 [Warning] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
2022-09-16T12:13:20.104745Z 0 [Warning] 'NO_AUTO_CREATE_USER' sql mode was not set.
2022-09-16T12:13:20.360860Z 0 [Warning] InnoDB: New log files created, LSN=45790
2022-09-16T12:13:20.407413Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2022-09-16T12:13:20.476844Z 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: f426651a-35b8-11ed-9823-00ffbed73b72.
2022-09-16T12:13:20.480432Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2022-09-16T12:13:22.298563Z 0 [Warning] A deprecated TLS version TLSv1 is enabled. Please use TLSv1.2 or higher.
2022-09-16T12:13:22.298842Z 0 [Warning] A deprecated TLS version TLSv1.1 is enabled. Please use TLSv1.2 or higher.
2022-09-16T12:13:22.301801Z 0 [Warning] CA certificate ca.pem is self signed.
2022-09-16T12:13:23.318333Z 1 [Note] A temporary password is generated for root@localhost: =UcF%uPQt5)p

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

D:\mysql-5.7.38-winx64\bin>mysql -u root -p
Enter password: ************
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.38

Copyright (c) 2000, 2022, Oracle and/or its affiliates.

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> ALTER USER 'root'@'localhost' IDENTIFIED BY 'sa@123';
Query OK, 0 rows affected (0.00 sec)

mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'sa@123' WITH GRANT OPTION;
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.01 sec)
复制



文章转载自云自由,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论