mybatis框架——实战练习——mysql8安装——mysql-8.0.29——用户名:root--密码:123456--数据库名:mysql8

下载网址:https://dev.mysql.com/downloads/mysql/

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

在C盘建立文件夹mysql8,并发下载的压缩文件放进去,并解压:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

新建my.ini配置文件,并输入如下内容:

 

[client]
# 设置mysql客户端默认字符集
default-character-set=utf8

[mysqld]
# 设置3306端口
port = 3306

# 设置mysql的安装目录
basedir=C:\\Program Files\\mysql8\\mysql-8.0.29-winx64\\mysql-8.0.29-winx64

# 设置 mysql数据库的数据的存放目录,MySQL 8+ 不需要以下配置,系统自己生成即可,否则有可能报错
# datadir=C:\\Program Files\\mysql8

# 允许最大连接数
max_connections=20

# 服务端使用的字符集默认为8比特编码的latin1字符集
character-set-server=utf8

# 创建新表时将使用的默认存储引擎
default-storage-engine=INNODB

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

以管理员身份运行cmd.exe

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

执行如下命令:

 

切换到安装目录:

1
cd C:\Program Files\mysql8\mysql-8.0.29-winx64\mysql-8.0.29-winx64\bin

 

 

初始化数据库;

mysqld --initialize --console

 

 

 

执行完成后,会打印root的初始密码: =aEB%&xdS4zo

 

 

 

 

输入以下安装命令:

mysqld install

 

 

启动输入以下命令即可:

net start mysql

 

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
C:\Windows\system32>cd C:\Program Files\mysql8\mysql-8.0.29-winx64\mysql-8.0.29-winx64\bin
 
C:\Program Files\mysql8\mysql-8.0.29-winx64\mysql-8.0.29-winx64\bin>mysqld --initialize --console
2022-05-21T05:08:32.502395Z 0 [System] [MY-013169] [Server] C:\Program Files\mysql8\mysql-8.0.29-winx64\mysql-8.0.29-winx64\bin\mysqld.exe (mysqld 8.0.29) initializing of server in progress as process 19696
2022-05-21T05:08:32.503495Z 0 [Warning] [MY-013242] [Server] --character-set-server: 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous.
2022-05-21T05:08:32.521934Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2022-05-21T05:08:32.987543Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2022-05-21T05:08:33.877566Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: =aEB%&xdS4zo
 
C:\Program Files\mysql8\mysql-8.0.29-winx64\mysql-8.0.29-winx64\bin>mysqld install
Service successfully installed.
 
C:\Program Files\mysql8\mysql-8.0.29-winx64\mysql-8.0.29-winx64\bin>net start mysql
MySQL 服务正在启动 .
MySQL 服务已经启动成功。
 
 
C:\Program Files\mysql8\mysql-8.0.29-winx64\mysql-8.0.29-winx64\bin>mysql -u root -p
Enter password: ******
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
 
C:\Program Files\mysql8\mysql-8.0.29-winx64\mysql-8.0.29-winx64\bin>mysql -u root -p
Enter password: ************
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 9
Server version: 8.0.29
 
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> show databases;
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
mysql> show database;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'database' at line 1
mysql> show database;

  

 

 

 

 

 

 

 

=========================================================================

 

 

 

下载Navicat;目前有14天免费试用期

 

 

设置连接名:myslq8;

 

用户名:   root

密码:   =aEB%&xdS4zo

 

 

创建一个新数据库,名为mysql8

 

 

 

 

 

 

参考网址:

 

https://blog.csdn.net/Dyoungwhite/article/details/122426288

 

https://www.runoob.com/mysql/mysql-install.html

 

 

 

 

 

 

 

修改新密码:  123456

 

posted @   小白龙白龙马  阅读(240)  评论(0编辑  收藏  举报
(评论功能已被禁用)
相关博文:
阅读排行:
· winform 绘制太阳,地球,月球 运作规律
· AI与.NET技术实操系列(五):向量存储与相似性搜索在 .NET 中的实现
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人
· 上周热点回顾(3.3-3.9)
· AI 智能体引爆开源社区「GitHub 热点速览」
点击右上角即可分享
微信分享提示