The new version of XAMPP replaces MySQL with 5.7.X

At the beginning of writing this article, I wanted to build a development experiment environment in a virtual machine, and then I thought that XAMPPthis tool can be started with one click Apache, MySQL... these services, I am too lazy to toss those environments.
I downloaded XAMPP 7.4.29the version here, in the official There are 8.0.19also 8.1.6two 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
download
expression
XAMPPMySQLmysql -V

It is recommended to use XAMPPthe function on the right side of the software: Shellopen the command window, otherwise it is not easy to connectMySQL

MySQL version
(Uh... I don’t know this version) I searched, yes, MariaDB 10.4.24it MySQL’s a branch, and the operation method is MySQLalmost the same, but 10.4.24this version is still too high. I’m afraid that the high-version database will not be compatible with my project. Here I will MySQLThe replacement version is 5.7.Xfirst
download a 5.7.Xdecompressed version of the file
download link:MySQL :: Download MySQL Community Server

Remember to stop the service before changing XAMPPthe MySQLversion

First backup the directory XAMPPunder the installation directorymysql

Unzip MySQLthe 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:
binlibshareXAMPPmysql
MySQL directory
XAMPPdata
cmdXAMPPmysql\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):
mysqlbinmy.iniXAMPPmysql\bin\
XAMPPMySQL
XAMPP
Logs
Log
MariaDB 10.4.24mysql\bin\my.ini
my. ini
MySQL
XAMPP

XAMPPShellMySQL
SHELL

XAMPPMySQL
cmdXAMPPmysql\bin\cmd

mysqld --skip-grant-tables

You will find that the service XAMPPin MySQLis automatically opened. Now
we log in from XAMPP.ShellMySQL

mysql -u root -p

Please add a picture description
Now you are logged in,
and then we continue to enter MySQLcommands 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 cmdwindows and XAMPP Shellwindows , and then re-open the service in . Next, continue to enter a new window and enter the command:XAMPPMySQL
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, XAMPPthe above MySQLis still different from the direct installation. Haha, in theory, this method MySQLshould also be applicable to other versions. If you want to install it, 8.Xyou 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)解决办法

Guess you like

Origin blog.csdn.net/weixin_44105042/article/details/127045916