MySql教程

mysql安装 8.0.25 zip

本文主要是介绍mysql安装 8.0.25 zip,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

好气啊,我用msi包安装了十几遍都没成功!!!!最终解决了 哎。。。心累

1.下载MySQL链接

https://dev.mysql.com/downloads/mysql/

2.解压zip 

        自己找个位置,解压完大致长这样(可别下载debug版本啊,哎。。。心累,我感觉把所有的坑踩了一遍)

 

4.初始化Mysql

创建文件(ACSI编码)  重点!!!!!!! 见下图

先新建一个文件,一般都是新建一个txt嘛, 编辑下面这段配置。之后另存为  my.ini, 还得配置编码我跟你讲!!!!

下面这个配置信息  basedir    datadir 这个换成自己的 `D:\soft\mysql-8.0.25-winx64`

\Data 别动  注意:Data文件夹不要手动创建,让他自动生成

my.ini文件代码如下:别抄我的 自己看着改改 主要是路径,如果一会报错了,试试将这两个地方的单\ 都改为\\ ,例如: 

`basedir=D:\\soft\mysql-8.0.25-winx64

datadir=D:\\soft\mysql-8.0.25-winx64\\Data`

[mysqld]
port=3306
basedir=D:\soft\mysql-8.0.25-winx64
datadir=D:\soft\mysql-8.0.25-winx64\Data
max_connections=200
max_connect_errors=10
character-set-server=utf8mb4
default-storage-engine=INNODB
default_authentication_plugin=mysql_native_password
[mysql]
default-character-set=utf8mb4
[client]
port=3306
default-character-set=utf8mb4

文件另存为,改一下编码,保存!!!!!

5.以管理员身份打开命令行

你可能跟我一样直接在文件夹里来个 cmd 打开的,不得行!!!!!

 切换到自己的mysql安装目录bin下

6.执行命令

mysqld --initialize --console

7.记住临时密码{注意,要等他执行完命令后自动退出}

最后就是 初始化密码  :  root@localhost: ZPv(aI(AU3<9

D:\software\mysql-8.0.25-winx64\bin>mysqld --initialize --console
2021-07-12T15:24:17.885560Z 0 [System] [MY-013169] [Server] D:\software\mysql-8.0.25-winx64\bin\mysqld.exe (mysqld 8.0.25) initializing of server in progress as process 10764
2021-07-12T15:24:17.889129Z 0 [ERROR] [MY-010457] [Server] --initialize specified but the data directory has files in it. Aborting.
2021-07-12T15:24:17.889149Z 0 [ERROR] [MY-013236] [Server] The designated data directory D:\software\mysql-8.0.25-winx64\Data\ is unusable. You can remove all files that the server added to it.
2021-07-12T15:24:17.907061Z 0 [ERROR] [MY-010119] [Server] Aborting
2021-07-12T15:24:17.911325Z 0 [System] [MY-010910] [Server] D:\software\mysql-8.0.25-winx64\bin\mysqld.exe: Shutdown complete (mysqld 8.0.25)  MySQL Community Server - GPL.

D:\software\mysql-8.0.25-winx64\bin>mysqld --initialize --console
2021-07-12T15:24:46.992290Z 0 [System] [MY-013169] [Server] D:\software\mysql-8.0.25-winx64\bin\mysqld.exe (mysqld 8.0.25) initializing of server in progress as process 3124
2021-07-12T15:24:47.010950Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-07-12T15:24:48.354787Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2021-07-12T15:24:51.641087Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: ZPv(aI(AU3<9

8.安装mysql服务

执行:mysqld --install

 

9.启动Mysql服务

还是在bin下执行:

net start mysql

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

10.修改密码

执行:mysql -u root -p

再输入刚刚保存的临时密码

如图出现出现(mysql> )字样代表成功

再执行(注意下面的语句是不是英文输入法的单引号)

ALTER USER 'root'@'localhost' IDENTIFIED BY 'admin';

密码就改成 admin了 

刷新权限,使新密码生效

flush privileges;

再次登录出现mysql即成功

最后附下my.ini 弄好之后的操作:

cd bin

D:\software\mysql-8.0.25-winx64\bin>mysqld --initialize --console
2021-07-12T15:24:17.885560Z 0 [System] [MY-013169] [Server] D:\software\mysql-8.0.25-winx64\bin\mysqld.exe (mysqld 8.0.25) initializing of server in progress as process 10764
2021-07-12T15:24:17.889129Z 0 [ERROR] [MY-010457] [Server] --initialize specified but the data directory has files in it. Aborting.
2021-07-12T15:24:17.889149Z 0 [ERROR] [MY-013236] [Server] The designated data directory D:\software\mysql-8.0.25-winx64\Data\ is unusable. You can remove all files that the server added to it.
2021-07-12T15:24:17.907061Z 0 [ERROR] [MY-010119] [Server] Aborting
2021-07-12T15:24:17.911325Z 0 [System] [MY-010910] [Server] D:\software\mysql-8.0.25-winx64\bin\mysqld.exe: Shutdown complete (mysqld 8.0.25)  MySQL Community Server - GPL.

D:\software\mysql-8.0.25-winx64\bin>mysqld --initialize --console
2021-07-12T15:24:46.992290Z 0 [System] [MY-013169] [Server] D:\software\mysql-8.0.25-winx64\bin\mysqld.exe (mysqld 8.0.25) initializing of server in progress as process 3124
2021-07-12T15:24:47.010950Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-07-12T15:24:48.354787Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2021-07-12T15:24:51.641087Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: ZPv(aI(AU3<9

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

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


D:\software\mysql-8.0.25-winx64\bin>mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

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

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

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安装 8.0.25 zip的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!