2022年最新版MySQL-8.0.27-winx64.zip详细安装教程停⽌服务怎样打开进程管理器
服务组件中到MySql服务组件 点击停⽌
卸载服务php猴子吃桃代码
以管理员⾝份运⾏cmd
使⽤mysqld -remove mysql卸载服务
Microsoft Windows [版本 10.0.19043.1466]
(c) Microsoft Corporation。保留所有权利。
C:\Windows\system32>mysqld -remove mysql
Service successfully removed.
到regedit把注册表关于mysql的清空
HKEY_LOCAL_MACHINE/SYSTEM/ControlSet001/Services/Eventlog/Applications/MySQL
HKEY_LOCAL_MACHINE/SYSTEM/ControlSet002/Services/Eventlog/Applications/MySQL
HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/Eventlog/Applications/MySQL
my.ini⽂件和data⽂件夹创建
在D:\DevTool\MySQL\mysql-8.0.27-winx64创建data⽂件夹
在D:\DevTool\MySQL\mysql-8.0.27-winx64创建⽂件my.ini,并写⼊以下内容
[mysqld]
# 设置3306端⼝
port=3306
# 设置mysql的安装⽬录 ---是你的安装路径---
basedir=D:\DevTool\MySQL\mysql-8.0.27-winx64
# 设置mysql数据库的数据的存放⽬录  ---安装路径下的data---
datadir=D:\DevTool\MySQL\mysql-8.0.27-winx64\data
# 允许最⼤连接数
mysql安装教程菜鸟课程max_connections=200
# 允许连接失败的次数。
max_connect_errors=10
12 tablets# 服务端使⽤的字符集默认为utf8mb4
character-set-server=utf8mb4
# 创建新表时将使⽤的默认存储引擎
default-storage-engine=INNODB
# 默认使⽤“mysql_native_password”插件认证
#mysql_native_password
default_authentication_plugin=mysql_native_password
[mysql]
# 设置mysql客户端默认字符集
default-character-set=utf8mb4
[client]
# 设置mysql客户端连接服务端时默认使⽤的端⼝
port=3306
default-character-set=utf8mb4
初始化
执⾏mysqld --initialize --console
D:\DevTool\MySQL\mysql-8.0.27-winx64\bin>mysqld --initialize --console
2022-02-11T15:30:00.012302Z 0 [Warning] [MY-010918] [Server] 'default_authentication_plugin' is deprecated and will be removed in a future release. Pl ease use authentication_policy instead.
2022-02-11T15:30:00.012756Z 0 [System] [MY-013169] [Server] D:\DevTool\MySQL\mysql-8.0.27-winx64\ (mysqld 8.0.27) initializing of ser ver in progress as process 1568
2022-02-11T15:30:00.319585Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2022-02-11T15:30:07.662867Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2022-02-11T15:30:18.891738Z 0 [Warning] [MY-013746] [Server] A deprecated TLS version TLSv1 is enabled for channel mysql_main
evaluation move2022-02-11T15:30:18.891854Z 0 [Warning] [MY-013746] [Server] A deprecated TLS version TLSv1.1 is enabled for channel mysql_main
2022-02-11T15:30:19.013316Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: 9LGqQ19wiP<n
安装mysql服务
执⾏mysqld --install mysql
D:\DevTool\MySQL\mysql-8.0.27-winx64>mysqld --install mysql
onload函数Service successfully installed.
启动服务
执⾏ net start mysql
D:\DevTool\MySQL\mysql-8.0.27-winx64\bin>net start mysql
mysql 服务正在启动 ..
mysql 服务已经启动成功。
停⽌服务 net stop mysql
连接MySQL
密码:9LGqQ19wiP<n
D:\DevTool\MySQL\mysql-8.0.27-winx64\bin>mysql -u root -p
Enter password: ************
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.27
Copyright (c) 2000, 2021, 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>
修改root密码
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY '123456';
Query OK, 0 rows affected (0.10 sec)
⽤到的命令总结
mysqld -remove mysql
mysqld --initialize --console
mysqld --install mysql
net start mysql
mysql -u root -p

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。