安装MySQL

win

1.下载安装包

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


下载完成,解压

2.配置系统变量

变量名:MYSQL_HOME
变量值:D:\app\mysql-8.4.1-winx64

3.安装MySQL

D:\app\mysql-8.4.1-winx64\bin>mysqld --initialize-insecure --user=mysql

D:\app\mysql-8.4.1-winx64\bin>mysqld -install
Service successfully installed.

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

D:\app\mysql-8.4.1-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.4.1 MySQL Community Server - GPL

mysql> use mysql;
Database changed
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY '991206';
Query OK, 0 rows affected (0.01 sec)

mysql> exit
Bye

D:\app\mysql-8.4.1-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.4.1 MySQL Community Server - GPL
posted @ 2024-07-04 22:09  Big-Kelly  阅读(2)  评论(0编辑  收藏  举报