Table of Contents
Example: MySQL5.7.19
Download" >Download
忘记root密码
Home Database Mysql Tutorial How to install MySQL 5.7 on Windows 10 and change the root password if you forget it

How to install MySQL 5.7 on Windows 10 and change the root password if you forget it

Oct 23, 2017 am 10:31 AM
root windows10

Example: MySQL5.7.19

Download

Of course you have to download it firsthttps://dev.mysql.com/downloads/mysql/ Official website download address. (Related mysql video tutorial recommendation: "mysql tutorial")

Choose the version that suits your computer, click Download, jump, and download directly No thanks.

Wait quietly for downloading and decompression. This is my decompression path D:\MySQL

Officially start the installation

##:Windows10

#:MySQL5.7.19

#After decompression

#However, there is no my.ini

Just create one, create a new text document->just change the suffix name to ini.

[Client]
#设置3306端口
port = 3306[mysqld]
#设置3306端口
port = 3306# 设置自己MySQL的安装目录
basedir=D:\MySQL
# 设置自己MySQL数据库的数据的存放目录
datadir=D:\MySQL\data
# 允许最大连接数
max_connections=200# 服务端使用的字符集默认为8比特编码的latin1字符集
character-set-server=utf8
# 创建新表时将使用的默认存储引擎default-storage-engine=INNODB
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
[mysql]
# 设置客户端默认字符集default-character-set=utf8
Copy after login
Then the next step is to configure the environment variables, just go to the picture above.

##This computer->Right-click, Properties->Advanced System Settings->Environment Variables

Variable name: MYSQL_HOME

##Variable value: Your own MySQL installation path

Next add Path, select Path editing, and add a new one: %MYSQL_HOME%\bin

##Confirm all the way.

#Open the command prompt, you must have administrator rights, otherwise the rights will not be enough.


cd /dD:\MySQL\bin Enter the bin directory. To enter the bin directory! It’s not written on the picture!

Then press the command in the picture.

Next mysql -u root -p enter MySQL It is not necessary to enter for the first time For password, just press Enter. Because I installed it before, I need a password.

Next update the password

MySQL5.7 no longer has the PASSWORD field. Changed to authentication_string

SO:

mysql>update mysql.user set anthentication_string=password('你的密码') where user='root';
mysql>flush privileges;//刷新MySQL的系统权限
mysql>quit;
Copy after login

再次mysql -u root -p进入就可以操作了。

mysql>show databases;
Copy after login

也可以下一个MySQL的图形化界面,SQLyog、Navicat之类的。

忘记root密码

也许时间久了密码会忘。

看图。

首先net stop mysql停掉服务;

若是停不掉:

Ctrl+Alt+Del打开任务管理器,在详细信息里结束mysql.exe任务。

进入bin目录

mysqld -nt --skip-grant-tables
Copy after login

现在这个命令提示符已经不可以继续用了。

重新打开一个管理员命令提示符输入mysql进入重新改密码就OK了。

The above is the detailed content of How to install MySQL 5.7 on Windows 10 and change the root password if you forget it. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Log in to Ubuntu as superuser Log in to Ubuntu as superuser Mar 20, 2024 am 10:55 AM

In Ubuntu systems, the root user is usually disabled. To activate the root user, you can use the passwd command to set a password and then use the su- command to log in as root. The root user is a user with unrestricted system administrative rights. He has permissions to access and modify files, user management, software installation and removal, and system configuration changes. There are obvious differences between the root user and ordinary users. The root user has the highest authority and broader control rights in the system. The root user can execute important system commands and edit system files, which ordinary users cannot do. In this guide, I'll explore the Ubuntu root user, how to log in as root, and how it differs from a normal user. Notice

Where to open windows 10 running Where to open windows 10 running Mar 19, 2024 pm 05:57 PM

Three commonly used methods: 1. The most convenient method is to press the Windows key and R key at the same time; 2. Access "Run" through the shortcut menu or start menu; 3. By entering specific commands, users can quickly start the program, Open files or folders, configure system settings, and more.

windows10 installation failed windows10 installation failed Mar 12, 2024 pm 05:09 PM

Solutions to failed Windows 10 installation: 1. Check the hardware; 2. Update the driver; 3. Use reliable installation media; 4. Clean the existing system; 5. Check the system requirements; 6. Adjust BIOS/UEFI settings; 7. Clear Virus.

windows10 activation key list latest 2024 windows10 activation key list latest 2024 Mar 19, 2024 pm 03:45 PM

Obtaining a Windows 10 activation key is key to fully experiencing its capabilities. The legal way is to purchase a genuine key and then activate it through the "Activate" option in the system settings. Using illegal or pirated keys can pose security risks and is a violation of intellectual property rights. This article will guide you through legal means to obtain and activate a Windows 10 activation key, ensuring the security of your computer and supporting the work of software developers.

What is the difference between the root and alias directives in Nginx configuration? What is the difference between the root and alias directives in Nginx configuration? May 12, 2023 pm 12:16 PM

Both root and alias can be defined in the location module, and are used to specify the real path of the requested resource, for example: location/i/{root/data/w3;} requests http://foofish.net/i/top.gif When this address is used, the corresponding real resource in the server is the /data/w3/i/top.gif file. Note: The real path is the value specified by root plus the value specified by location. And alias is just like its name. The path specified by alias is the alias of location. No matter how the value of location is written, the real path of the resource is the path specified by alias, such as

Step by step using Python to delete long path files under Windows Step by step using Python to delete long path files under Windows Apr 12, 2023 pm 01:31 PM

0x01 Background of the article Recently, the storage of a business system of the author's company is approaching the limit, and the server will soon be unable to run. Because the business system A contains multiple subsystems A1, A2, A3... An, the middle of these subsystems Due to design reasons, the stored files are all stored in the same parent directory. The only difference is that the names of files and folders generated by different subsystems all start with the name of the subsystem. For example, the files generated by the A1 subsystem are all named A1xxxxxx​, and the file names generated by the A2 subsystem are all A2xxxxx. Now we need to delete the historical files of some of these subsystems to free up server space. Dozens of terabytes of data are stored together. Manual deletion will definitely not show up. We can only use program automation.

How to change the root user name in Linux How to change the root user name in Linux May 18, 2023 pm 07:50 PM

1. Taking CentOS as an example, after logging in, modify /etc/passwd and /etc/shadow, change the root starting on the first line to a new user name (such as admin), and save through wq! after modification. 2. After modifying and saving, it will take effect after restarting the server. You can check the permissions of the file and see that the account column has changed to admin, as follows: Note: The default user with the highest administrative authority in Linux is root, uid is 0. Only uid is recognized in the system, so as long as uid is 0, the system is regarded as the highest administrative user. However, there may be certain problems with applications. Some software uses the root user by default, so if you have limited understanding of software applications,

Advantages and Disadvantages of Rooting Your Phone Advantages and Disadvantages of Rooting Your Phone Jul 06, 2023 pm 04:53 PM

The benefits of rooting your phone: 1. You can back up the system; 2. You can use advanced programs; 3. You can modify and delete system programs; 4. You can install programs on the SD card; 5. You can modify system fonts, etc. Disadvantages: 1. After the mobile phone is rooted, it is easy to be invaded by Trojan viruses; 2. System damage may occur due to incompleteness and software compatibility issues; 3. After the mobile phone is rooted, the software mistakenly deletes system files, causing system errors; 4. There is a risk that user privacy will be leaked after rooting the phone, etc.

See all articles