当前位置:网站首页>利用cmd(命令提示符)安装mysql&&配置环境
利用cmd(命令提示符)安装mysql&&配置环境
2022-06-25 12:14:00 【xiongᥫᩣ】
目录
一,解压
大家可以从网上下载mysql的压缩包用于安装,下载好压缩包后第一步首先解压。
二,配置环境变量
1.找到桌面上的此电脑,右键选择属性

2.进入设置过后,下滑点击高级系统设置

3.进入高级系统设置后点击环境变量

4.点击新建,增加一个系统变量

5.变量名直接用 MYSQL_HOME 变量值就用你的mysql文件夹的存放位置

三,编辑path
1.在系统变量中找到 Path

2.双击进入 Path 点击新建添加一个环境变量

四,新建my.ini
1.将文件复制粘贴至MySQL文件夹中去

2.右键点击编辑,将里面的默认路径替换为你存放MySQL文件夹的路径

以下操作需先进入bin目录中
五,安装
win+r 输入 cmd 进入命令提示符中去,再进入到bin目录中去
以下是博主的代码:
C:\Users\Administrator>f:
F:\>cd mysql5.7
F:\mysql5.7>cd mysql-5.7.23-winx64
F:\mysql5.7\mysql-5.7.23-winx64>cd bin
F:\mysql5.7\mysql-5.7.23-winx64\bin>

再输入以下代码进行MySQL的安装
mysqld -install
六,初始化
根据刚刚my.ini文件去初始化,然后会产生一个data文件夹
mysqld --initialize-insecure --user=mysql

七,启动
在cmd中输入以下代码,用去启动MySQL
net start mysql
打开任务管理器此时可以看到已经有MySQL的存在了

八,设置密码
在password后面输入新密码,然后点击enter进行下一步
mysqladmin -u root -p password 新密码

Enter password: 旧密码 直接回车,因为初始化直接把mysql的密码设置为空 ,所以初次的旧密码为空

九,连接
在cmd中输入以下代码:
当发现数据库可以显示后,就代表已经MySQL已经安装成功了
连接 mysql -uroot -p ;
显示数据库 show databases;
显示表 show tables;
今天的知识分享就到此为止啦,精彩下期继续!有问题可以在评论区留言或私信博主哦
边栏推荐
- Development with courtesy -- share the source code of the secondary development of the app system of the imitation shopping mall
- Maximum number [abstract rules for abstract sorting]
- (2) Pyqt5 tutorial -- > using qtdesigner to separate interface code
- 初识CANOpen
- PHP replaces the key of a two-dimensional array with a specified element value
- Possible causes of wechat applet decryption failure
- Micro engine remote attachment 7 Niu cloud upload
- Thinkphp3 use phpword to modify the template and download it
- 2021-09-22
- node. JS architecture optimization: reverse proxy and cache service
猜你喜欢

(4) Pyqt5 tutorial -- > Custom signal and slot (super winding...)

2021-09-22

laravel 9

Zhangxiaobai's way of penetration (V) -- detailed explanation of upload vulnerability and parsing vulnerability

Jeecgboot startup popup configuration is still incorrect

微信全文搜索技术优化

Three jobs! You can learn this from me (attached with graduation vlog)

Laravel excel export

ECSHOP quickly purchases goods, simplifies the shopping process, and improves the user experience through one-step shopping

Zhangxiaobai's road of penetration (IV) -- detailed explanation of XSS cross site script vulnerabilities
随机推荐
阿里稳定性之故障应急处理流程
Laravel task scheduling
顺序表的折半查找法
Node child processes and threads
QT TCP UDP network communication < theory >
Disconnected: No supported authentication methods available (server sent: )
2021-09-22
JQ dynamic setting radio does not take effect when selected
Spicy food advertising e-commerce system development function and spicy food advertising e-commerce app system development source code sharing
Penetration tool environment - Installation of sqlmap
The drop-down box renders numbers instead of the corresponding text. How to deal with it
Idea2017 how to set not to automatically open a project at startup
Go from 0 to 1. Obtain the installation package, get, post request, params, body and other parameters
Zhangxiaobai's road to penetration (7) -sql injection detailed operation steps -union joint query injection
Slice and slice methods of arrays in JS
Figure explanation of fiborache sequence
Methods of strings in JS charat(), charcodeat(), fromcharcode(), concat(), indexof(), split(), slice(), substring()
Digital currency exchange -- digital currency exchange system development source code sharing
Repair the error that ECSHOP background orders prompt insufficient inventory when adding goods. Please reselect
PHP files running online