当前位置:网站首页>Install MySQL from scratch (MySQL installation document - unzipped version)
Install MySQL from scratch (MySQL installation document - unzipped version)
2022-07-29 06:19:00 【Programming sail】
Installation environment :Win10 64 position Software version :MySQL 5.7.24 Decompression version
MYSQL I have already placed the compressed package of , If the official website is slow to download, you can come to official account Xiao Jin's programming journey reply mysql Get it oh
One 、 download
Click the link below : https://downloads.mysql.com/archives/community/
Select the version corresponding to the number of digits in your system and click on the right Download, It will go to another page , Also find the position shown below near the bottom of the page :
Ignore the login and registration buttons above , Just click No thanks, just start my download. You can download .
Two 、 install ( decompression )
After downloading, we get a compressed package , Unzip it , We can get it MySQL 5.7.24 Software ontology ( It's a folder ), We can put it where you want to install it .
3、 ... and 、 To configure
- Add environment variables
There are many options in environment variables , Here we only use Path This parameter . Why add environment variables at the beginning of initialization ? In black box ( namely CMD) Enter the name of an executable program ,Windows Will be in the environment variable first Path Look in the path indicated , If you find it, execute it directly , Not found, just find it in the current working directory , If you haven't found it yet , Just report a mistake . The purpose of adding environment variables is to directly call... In any black box MySQL Instead of always modifying the working directory , Greatly simplified operation .
Right click this computer → attribute , Click Advanced System Settings
Click environment variable 
Create a new... In the system variable MYSQL_HOME
Locate and double-click in the system variable Path
Click New 
Finally, click OK .
How to verify whether the addition is successful ?
Right click to start menu ( It's the lower left corner of the screen ), Select the command prompt ( Administrators ), Open the black box , Knock in mysql, enter . If you are prompted Can’t connect to MySQL server on 'localhost’ It proves that the addition is successful ; If you are prompted mysql Not an internal or external command , If it is not a runnable program or batch file, it indicates that the addition failed , Please recheck the steps and try again .
- New configuration file
Create a new text file , The contents are as follows :
[mysql]
default-character-set=utf8
[mysqld]
character-set-server=utf8
default-storage-engine=INNODB
sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
Save the above text file as , Select all files in the save type (.), File name my.ini, The storage path is MySQL Root directory ( For example, mine is D:\software\mysql-5.7.24-winx64, According to their own MySQL Directory location modification ).
The code means that the default code set of the configuration database is utf-8 And the default storage engine is INNODB.
3. initialization MySQL
Knock in the black box just now mysqld --initialize-insecure, enter , Wait a little bit , If there is no error message ( Here's the picture ) Then prove data There is no problem with directory initialization , Check again at this time MySQL There are already data Directory generation .
mysqld --initialize-insecure

tips: If the following error occurs 
Due to insufficient permissions , Go to C:\Windows\System32 Run as administrator under cmd.exe

4. register MySQL service
Type in... In the black box mysqld -install, enter .
mysqld -install

Now your computer has been installed MySQL Yes .
MySQL The server
5. start-up MySQL service
Type in... In the black box net start mysql, enter .
net start mysql // start-up mysql service
net stop mysql // stop it mysql service

6. Modify default account password
Type in... In the black box mysqladmin -u root password 1234, there 1234 Default administrator ( namely root Account ) Password , It can be modified to what you like .
mysqladmin -u root password 1234
thus ,MySQL 5.7 The decompressed version has been installed !
Four 、 Sign in MySQL
Right click to start menu , Select the command prompt , Open the black box . Enter... In the black box ,mysql -uroot -p1234, enter , The following figure appears and the lower left corner is mysql>, Login succeeded .
mysql -uroot -p1234

Here you can start your MySQL On a journey !
sign out mysql:
exit
quit
Login parameters :
mysql -u user name -p password -h To connect the mysql Server's ip Address ( Default 127.0.0.1) -P Port number ( Default 3306)
5、 ... and 、 uninstall MySQL
If you want to uninstall MySQL, It's also very simple. .
Right click to start menu , Select the command prompt ( Administrators ), Open the black box .
Knock in net stop mysql, enter .
net stop mysql

Then knock in mysqld -remove mysql, enter .
mysqld -remove mysql

Finally delete MySQL Directory and related environment variables .
thus ,MySQL Uninstall completed !
For more exciting content, click follow , It's going to be a long time ~
Official account Xiao Jin's programming journey More programming resources are preferred ~
边栏推荐
猜你喜欢

SQLyog 安装和配置教程

【软件工程之美 - 专栏笔记】27 | 软件工程师的核心竞争力是什么?(上)

Jingwei Qili: OLED character display based on hmep060 (and Fuxi project establishment demonstration)

Based on stc51: schematic diagram and source code of four axis flight control open source project (entry-level DIY)

基于51单片机的DAC0832波形发生器

2022 spring recruit - Hesai technology FPGA technology post (one or two sides, collected from: Digital IC workers and FPGA Explorers)

LeetCode #35.搜索插入位置

多线程和并发

简洁代码实现pdf转word文档

【软件工程之美 - 专栏笔记】24 | 技术债务:是继续修修补补凑合着用,还是推翻重来?
随机推荐
单链表面试题
基于51单片机的直流电机调速系统(L298的使用)
进程与进程的概念
Huawei cloud 14 days Hongmeng device development -day1 environment construction
基于wifi的温度采集与控制系统
【软件工程之美 - 专栏笔记】17 | 需求分析到底要分析什么?怎么分析?
leetcode刷题笔记 763.划分字母区间(中等)
QT learning notes - Import and export of Excel
Ml8 self study notes LDA principle formula derivation
【软件工程之美 - 专栏笔记】26 | 持续交付:如何做到随时发布新版本到生产环境?
八大排序-----------------堆排序
NFC双向通讯13.56MHZ非接触式阅读器芯片--Si512替代PN512
IDEA 实用快捷键 新手必看
QT learning notes QT model/view
LeetCode #876.链表的中间结点
基于F407ZGT6的WS2812B彩灯驱动
Huawei cloud 14 day Hongmeng device development -day2 compilation framework
基于stm32的四针OLED显示
【软件工程之美 - 专栏笔记】14 | 项目管理工具:一切管理问题,都应思考能否通过工具解决
【软件工程之美 - 专栏笔记】“一问一答”第3期 | 18个软件开发常见问题解决策略