Mysql relational database free installation package download and installation tutorial

      For most beginners related to technical computing, the mysql relational database is undoubtedly the most suitable for beginners to learn and use, but it may not be particularly clear how to install the mysql database. Most of the Internet is the .msi installation package of the official website, which comes with mysql client and some other related programs. In fact, it cannot be used at all. To be honest, the built-in client is not suitable for beginners. It is recommended to use the navicat database client or More conveniently, in the previous article, the client download address of navicat: https://blog.csdn.net/weixin_42958164/article/details/128778728

Next, start directly how to download and install the mysql database on the windows computer, the offline installation package download address Baidu network disk: https://pan.baidu.com/s/1TCFiQlDb1yYqtMKLLKR1Pg  Password: 65wq

After the download is complete

Find a relatively large space and decompress the installation package. It is recommended not to install on the c drive. The example after decompression is as follows:

 

Manually create the my.ini file in this directory, the content is as follows (copy the content in the dotted line):
----------------------------- --------------

[client]
port=3306
default-character-set=utf8
[mysqld] 
# Set as your own MYSQL installation directory 
basedir=D:\mysql-5.7.20-winx64
# Set as MYSQL's data directory 
datadir=D:\mysql- 5.7.20-winx64\data
port=3306
character_set_server=utf8
sql_mode=NO_ENGINE_SUBSTITUTION,NO_AUTO_CREATE_USER
#Open query cache
explicit_defaults_for_timestamp=true
#If this option is enabled, no password is required to log in to mysql. After entering mysql, alter or update the root password and comment out here
skip-grant-tables 

-------------------------------------------

Add system variables (add the bin path to the path in the system variable, win 7 needs to be separated by ;)


Open cmd as an administrator in the bin directory of mysql,

After entering, execute the following command:
first execute mysqld -remove #Remove the original service before
executing mysqld -install #Download the new service default service name is mysql
#If you create a new service MySQL2, execute: mysqld install MySQL2 -- defaults-file="D:\mysql-5.7.26-winx64\my.ini" 
If there is no data folder in the mysql directory, you need to open cmd to create it under "D:\mysql-5.7.26-winx64", command As follows:
mysqld --initialize-insecure --user=mysql

 After the above steps are completed,

Execute net start mysql #If the service cannot be started, restart the computer, execute it once, you can also go to the "management" of my computer to find the "service" in the "service and application" to start mysql manually; if it cannot be started, then Restart the computer.

Modify password settings:

Enter mysql in cmd and press Enter to enter the following command in the mysql library (choose one of the three commands);

set password for username@localhost = password('new password');
update user set password=password('123456') where user='root' and host='localhost';
ALTER USER 'root'@'localhost' IDENTIFIED BY '123456'; #The new password can be set to 123456, which is simple and universal.
If the password cannot be set, please refresh the permissions. After setting the password,
execute FLUSH PRIVILEGES after the password is set; #Refresh permissions

Finally, restart cmd, enter the mysql -u root -p password, press Enter to enter mysql, and the installation is complete if it succeeds.

(net start mysql starts the service, net stop mysql stops the service; the service name of mysql is the same as the service name manually started in the management service; if it is different, it cannot be started.)

Guess you like

Origin blog.csdn.net/weixin_42958164/article/details/128865413