当前位置:网站首页>Install mysql5.5 and mysql8.0 under windows at the same time
Install mysql5.5 and mysql8.0 under windows at the same time
2022-07-06 10:55:00 【Programmer seven seven】
One 、 install mysql8.0
What I installed first was mysql5.5, Such as :MySQL5.5 Installation tutorial +SQLyog install _ Qiqi's blog -CSDN Blog _mysql5.5 Installation steps of
1. Download decompression
link :https://pan.baidu.com/s/13T-J-7rQI8iCMN2wE2Pxtw
Extraction code :2022
2. Create a configuration
After downloading , It is recommended to unzip to a path without Chinese , Create... In the extracted directory my.ini The configuration file

# These are the basic configuration information
[client]
# Set up mysql Client default character set
default-character-set=utf8
[mysqld]
# Set up 3306 port , I 5.5 Version with 3306 了 , It works 3307
port = 3307
# Set up mysql Installation directory
basedir=D:\MySQL8.0\mysql-8.0.26-winx64
# Set up mysql Database data storage directory
datadir=D:\MySQL8.0\mysql-8.0.26-winx64\data
# Maximum connections allowed
max_connections=20
# The character set used by the server defaults to 8 Bit coded latin1 Character set
character-set-server=utf8
# The default storage engine that will be used when creating a new table
default-storage-engine=INNODB
3. initialization MySQL
Administrators CMD Enter the bin Catalog , Input mysqld --defaults-file=D:\MySQL8.0\mysql-8.0.26-winx64\my.ini --initialize --console
4. install MySQL service
Input mysqld install MySQL2 service name Do not enter the service name , The default is mysql
5. Sign in MySQL
Start the service first

Log in to the specified port , because 3306 By 5.7 The version uses mysql -uroot -p -P3307

Change Password , What I just generated is a temporary password , Have to change .
Input ALTER USER "root"@"localhost" IDENTIFIED BY " New password ";

Now the installation is complete .
Two 、 Solve password forgetting
Method 1 :
First step : close Mysql service
First stop mysql service . It can be done by net stop mysql Or close... In the task manager .
With Administrator rights operation :( This is the first window )
The second step : skip Mysql Password authentication
Go to the command prompt ( Administrator login ) operation , Get into mysql Directory bin Under the folder ,mysql8.0 The difference from other versions is that they cannot be used directly mysqld --skip-grant-tables To skip password login . Here we use mysqld -console --skip-grant-tables --shared-memory To skip permission verification .

No feedback after input execution , Open a new administrator window and re execute .( This is the second window )
After entering the catalog , Make sure you're closed Mysql Service for :net stop mysql
close Mysql After the service , Continue to D:\mysql-8.0.19-winx64\bin Operating under the directory :
Input
mysqld --console --skip-grant-tables --shared-memory
After entering this line of code , As shown below , We have successfully skipped Mysql Login with your password :
The third step : Enter without password Mysql
After the above steps , Open another administrator mode cmd.exe ( This is the third window )
Get into mysql Under the bin After the directory , Direct login mysql
No need to pass net start mysql open mysql service
Enter the following code on the command line
d:
cd D:\mysql-8.0.19-winx64\bin( Enter the installation directory on your computer here )
mysql -u root -p
Pictured :
A message appears asking you to enter your password , Directly enter , You can successfully connect Mysql.
Step four : Set the login password to blank
Enter the code , Set password to empty ( You cannot change the password directly at this time , Must be set to null first , Otherwise, an error will be reported )
Input :
use mysql; ( Use mysql Data sheet )
update user set authentication_string='' where user='root';( Leave the password blank )
quit; ( And then quit Mysql)
Operation as shown in figure :
Step five : Change your login password
There are two parts here
1. Close the first two cmd window ( Be sure to close !);
2. Enter the code in the third window ;
net stop mysql( close mysql service , Although it will show that the service is not enabled , But just in case )
net start mysql( And on again mysql service )
( Don't bother here , If the last one mysql The service is not closed , We still log in without password )
Operation as shown in figure :
Then the input :
cd D:\mysql-8.0.19-winx64\bin ( Enter the installation directory on your computer here )
mysql -u root -p
( Enter password... Will be displayed here , Just go straight back , Step 4 we have left him empty )
ALTER USER 'root'@'localhost' IDENTIFIED BY 'root';( Change password )
Pictured :
The last step : Verify that the password was modified successfully
Input :
quit( sign out mysql)
mysql -u root -p
( Enter the new password , Log in again )
Icon :
success !
Method 2 :
modify my.in/my.cnf The configuration file
Get into mysql The installation directory
edit my.ini
stay [mysqld] Add below skip-grant-tables, Save it .
Open the command line as an administrator
① restart mysql:
1、net stop mysql 2、net start mysql
② Get into mysql, Sign in
mysql -u root -p
No password required , Directly enter ( appear Enter Password It's the same. Go straight back , You can login successfully )③ Input use mysql, modify root Password :
update user set authentication_string=password(' New password ') where user='root';
flush privileges;④ sign out :
quit;
⑤ Restart again mysql:
1、net stop mysql 2、net start mysql
⑥ Whether the test is successful is whether the login is successful .
mysql -u root -pEnter Password>' New password '
3、 ... and 、 uninstall
1. Out of Service
Administrators CMD, Input net stop mysql, I opened two services , therefore net stop mysql2
Select the version you want to delete OK 了

2. Uninstall service
I choose to delete the second

3. Delete installation files
Installation directory and data directory , All deleted .

4. Delete registry information
Registry path
- HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Eventlog\Application\
- HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application\

边栏推荐
- CSDN问答标签技能树(一) —— 基本框架的构建
- MySQL 29 other database tuning strategies
- API learning of OpenGL (2004) gl_ TEXTURE_ MIN_ FILTER GL_ TEXTURE_ MAG_ FILTER
- MySQL 20 MySQL data directory
- [paper reading notes] - cryptographic analysis of short RSA secret exponents
- API learning of OpenGL (2003) gl_ TEXTURE_ WRAP_ S GL_ TEXTURE_ WRAP_ T
- csdn-Markdown编辑器
- API learning of OpenGL (2002) smooth flat of glsl
- 虚拟机Ping通主机,主机Ping不通虚拟机
- CSDN markdown editor
猜你喜欢

windows下同时安装mysql5.5和mysql8.0
![[recommended by bloggers] asp Net WebService background data API JSON (with source code)](/img/04/c721e6177b578b30cbbf334cb1b6c9.png)
[recommended by bloggers] asp Net WebService background data API JSON (with source code)

CSDN-NLP:基于技能树和弱监督学习的博文难度等级分类 (一)

MySQL36-数据库备份与恢复

Nanny hand-in-hand teaches you to write Gobang in C language

MySQL 20 MySQL data directory

MySQL32-锁

Mysql25 index creation and design principles

【C语言】深度剖析数据存储的底层原理

Csdn-nlp: difficulty level classification of blog posts based on skill tree and weak supervised learning (I)
随机推荐
MySQL35-主从复制
Copy constructor template and copy assignment operator template
虚拟机Ping通主机,主机Ping不通虚拟机
windows无法启动MYSQL服务(位于本地计算机)错误1067进程意外终止
[paper reading notes] - cryptographic analysis of short RSA secret exponents
SSM整合笔记通俗易懂版
Mysql 其他主机无法连接本地数据库
Mysql25 index creation and design principles
Nanny hand-in-hand teaches you to write Gobang in C language
MySQL33-多版本并发控制
@Controller, @service, @repository, @component differences
Global and Chinese markets of static transfer switches (STS) 2022-2028: Research Report on technology, participants, trends, market size and share
pytorch的Dataset的使用
A brief introduction to the microservice technology stack, the introduction and use of Eureka and ribbon
Adaptive Bezier curve network for real-time end-to-end text recognition
Yum prompt another app is currently holding the yum lock; waiting for it to exit...
虚拟机Ping通主机,主机Ping不通虚拟机
Invalid global search in idea/pychar, etc. (win10)
[BMZCTF-pwn] 12-csaw-ctf-2016-quals hungman
Mysql36 database backup and recovery