标签:code 根目录 block art stop 环境变量 completed 需要 3.1
[mysql] #设置mysql客户端默认字符集` default-character-set=utf8 [mysqld] #设置3306端口 port = 3306 # 设置mysql的安装目录 basedir=D:/mysql-8.0.11-winx64 # 设置mysql数据库的数据的存放目录 datadir=D:/mysql-8.0.11-winx64/data # 允许最大连接数 max_connections=2000 # 允许连接失败的次数。这是为了防止有人从该主机试图攻击数据库系统 max_connect_errors=100 # 服务端使用的字符集默认为8比特编码的latin1字符集 character-set-server=utf8 # 创建新表时将使用的默认存储引擎 default-storage-engine=INNODB [client] # 设置mysql客户端连接服务端时默认使用的端口 port=3306 default-character-set=utf8
win + Q
搜cmd
,右击选以管理员身份执行,不要用管理员身份执行PowerShell
cd D:\mysql-8.0.11-winx64\bin
mysqld --initialize --console
D:\mysql-8.0.11-winx64\bin>mysqld --initialize --console
2018-07-18T14:48:26.396790Z 0 [System] [MY-013169] [Server] D:\mysql-8.0.11-winx64\bin\mysqld.exe (mysqld 8.0.11) initializing of server >in progress as process 15216
2018-07-18T14:48:38.445099Z 5 [Note] [MY-010454] [Server] A temporary >password is generated for root@localhost: 3s6RMDg,kawT
2018-07-18T14:48:45.351367Z 0 [System] [MY-013170] [Server] D:\mysql-8.0.11-winx64\bin\mysqld.exe (mysqld 8.0.11) initializing of server has completed
[Note] [MY-010454] [Server] A temporary >password is generated for root@localhost: 3s6RMDg,kawT
其中root@localhost:
后面的3s6RMDg,kawT
就是初始密码(不含首位空格)。
- 需要记住这个密码,
步骤2.7
需要用到。
mysqld --install [服务名]
D:\mysql-8.0.11-winx64\bin>mysqld --install MySQL
Service successfully installed.
MySQL8
net start [服务名]
net stop [服务名]
是停止服务的命令D:\mysql-8.0.11-winx64\bin>net start mysql
MySQL 服务正在启动 ..
MySQL 服务已经启动成功。
mysql -u root -p
步骤2.5
记录的密码即可登录成功,进入MySQL命令模式。ALTER USER ‘root‘@‘localhost‘ IDENTIFIED WITH mysql_native_password BY ‘新密码‘;
mysql> ALTER USER ‘root‘@‘localhost‘ IDENTIFIED WITH mysql_native_password BY ‘root‘;
Query OK, 0 rows affected (0.10 sec)
PatchNavicat.exe
MySQL-8.0.11与Navicat Premium安装教程
标签:code 根目录 block art stop 环境变量 completed 需要 3.1
原文地址:https://www.cnblogs.com/wangfeixiong/p/9350029.html