At the beginning of writing this article, I wanted to build a development experiment environment in a virtual machine, and then I thought that XAMPP
this tool can be started with one click Apache
, MySQL
... these services, I am too lazy to toss those environments.
I downloaded XAMPP 7.4.29
the version here, in the official There are 8.0.19
also 8.1.6
two versions uploaded at the same time . Ask me why I use it 7.4.29
, and it will never be wrong to follow the pace of downloading by the public.
Download address: After installing, we open the software to start the service, and then enter the command to see the version numberXAMPP - Browse /XAMPP Windows at SourceForge.net
XAMPP
MySQL
mysql -V
It is recommended to use
XAMPP
the function on the right side of the software:Shell
open the command window, otherwise it is not easy to connectMySQL
(Uh... I don’t know this version) I searched, yes, MariaDB 10.4.24
it MySQL
’s a branch, and the operation method is MySQL
almost the same, but 10.4.24
this version is still too high. I’m afraid that the high-version database will not be compatible with my project. Here I will MySQL
The replacement version is 5.7.X
first
download a 5.7.X
decompressed version of the file
download link:MySQL :: Download MySQL Community Server
Remember to stop the service before changing
XAMPP
theMySQL
versionFirst backup the directory
XAMPP
under the installation directorymysql
Unzip MySQL
the compressed package just downloaded . Copy the , , directory inside to the directory under the directory. If there are files in the directory under the directory , delete them all . Open the directory under the directory as an administrator , and then run the command:bin
lib
share
XAMPP
mysql
XAMPP
data
cmd
XAMPP
mysql\bin\
mysqld --initialize
Initialize, it will automaticallydata
create a new file in the directory, and copy and replace the files in the directory in the directory just backed up to the directory in the directory. Going here, it’s ok in theory, we run the service to see if there is an error, we Check the log file to find a problem, prompt unknown variable, I guess this should be a new addition, let's go to the file to find it, if there is, comment it out, and then run the service again Successfully change the version and now you will find a new problem , Enter from the right side of the software : the password is incorrect. Now we are shutting down the service . Open the directory under the access directory as an administrator , and enter the command to skip the permission verification ( do not close this window, this method of skipping the permission verification is temporary , it will be invalid after closing this window, just put it in the background):
mysql
bin
my.ini
XAMPP
mysql\bin\
XAMPP
MySQL
Logs
MariaDB 10.4.24
mysql\bin\my.ini
MySQL
XAMPP
Shell
MySQL
XAMPP
MySQL
cmd
XAMPP
mysql\bin\
cmd
mysqld --skip-grant-tables
You will find that the service XAMPP
in MySQL
is automatically opened. Now
we log in from XAMPP
.Shell
MySQL
mysql -u root -p
Now you are logged in,
and then we continue to enter MySQL
commands to modify the root user password, do not enter anything else, you must first change the password to empty
use mysql;
update user set authentication_string='' where user='root';
quit;
After inputting, close all cmd
windows and XAMPP Shell
windows , and then re-open the service in . Next, continue to enter a new window and enter the command:XAMPP
MySQL
XAMPP Shell
mysql -u root -p
If the password is empty, press Enter directly, and then reset the password. I will change it here 123456
, and you can do it according to your own ideas.
ALTER USER 'root'@'localhost' IDENTIFIED BY '123456';
quit;
Then re-enter the command to log in
mysql -u root -p
Now you will find that the password has been changed
Ok, finished writing, XAMPP
the above MySQL
is still different from the direct installation. Haha, in theory, this method MySQL
should also be applicable to other versions. If you want to install it, 8.X
you just skip the password verification. It may be different. You can refer to this article blog:ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password: NO)解决办法