mysql-8.0.20-winx64.zip最新安装详解
1.在mysql默认目录,新建my.ini 配制文件(也可网络上找),文件格式如下:
[client]
port=3306
default-character-set=UTF8MB4
[mysqld]
port=3306
character_set_server=UTF8MB4
basedir="E:\mysql-8.0.20-winx64"
datadir="E:\mysql-8.0.20-winx64\data"
max_connections=200
default-storage-engine=INNODB
#跳过输密码的阶段
#skip-grant-tables
#Server="E:\mysql-8.0.20-winx64\bin\mysqld.exe"
2、cmd进入命令行,并进入相应的mysql解压bin目录E:\mysql-8.0.20-winx64\bin>(这个目录是我自己的,你们的目录别问我)执行如下命令
PS E:\mysql-8.0.20-winx64\bin> mysqld -install
//初始化,默认生成data文件目录[color=#FF6600]
PS E:\mysql-8.0.20-winx64\bin> mysqld --initialize -user=mysql
PS E:\mysql-8.0.20-winx64\bin> net start mysql
MySQL 服务正在启动 .
MySQL 服务已经启动成功。
PS E:\mysql-8.0.20-winx64\bin> mysql -u root -p
Enter password: ************(此处的密码是data文件的日志密码root@localhost: ********)
//显示登录成功
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.20
Copyright (c) 2000, 2020, 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.