Table of contents
5 MySQL configuration environment
1 download
Official download address: MySQL :: Download MySQL Installer
2 installation
Double-click the downloaded installation package
Wait for the installer to load
Some partners may fail to verify their identity during the loading process or prompt you to upgrade the installer
Click continue to run, do not upgrade
This interface appears after loading is complete
choose
custom——》next
Select MySQL5.7 x64
You can change the location (it is recommended not to put the c drive)
start installation
After the installation is complete, click next
next——"next to the following interface
Development Computer: development machine, this type of application will use the minimum amount of memory.
Server Computer: server, this type of application will use a medium size of memory.
Dedicated Computer: Dedicated server, this type of application will use the currently available maximum memory.
Here we choose "Development Computer" is enough for us.
Set the MySQL password, it is recommended to be simple, remember
Select server file permissions
Attach the translation, here we choose the default
Install
Some partners may have some problems during the installation process,
For example, here I am stuck at starting server during installation
报:Feiled to start MySQL Server
Here is the solution
Right click on This Computer -> Click Manage
Right click on the service --> Properties
After modification, come back and continue the installation
next
finish
The installation is complete
3 Environment Configuration
Find the my.ini file
This file path was changed when the installation path was changed earlier.
innodb_flush_log_at_trx_commit=1 changed to
innodb_flush_log_at_trx_commit=0
innodb_buffer_pool_size=128M changed (expand the buffer pool)
innodb_buffer_pool_size=1G
Change the MySQL encoding format
Add under [client]
default-character-set=utf8
Add under [mysql]
character-set-server=utf8
Add under [mysqld]
character-set-server=utf8
4 Mysql failed to start and reported ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
It's likely that your password is wrong
The solution is as follows:
1. Skip login
Enter the following command at the command line
mysqld --skip-grant-tables (versions other than MySQL8 can be used)
mysqld -console --skip-grant-tables --shared-memory (MySQL8 version uses this)
2. Enter the sql statement: (first leave the password blank)
use mysql; (use mysql data table)
update user set authentication_string='' where user='root'; (set the password to be empty)
quit; (then quit Mysql)
3. Restart the mysql service
4. Log in again and change your password
ALTER USER 'root'@'localhost' IDENTIFIED BY 'root'; (change password)
The method is borrowed from: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) solution_Xixia♪'s Blog-CSDN Blog
5 MySQL configuration environment
In the above steps, we can only enter mysql in the bin directory of the MySQL installation path
Now configure the environment variables so that we can enter MySQL by opening the command line
Right-click on this computer—"Properties—"Advanced System Settings—"Environment Variables——"Find the path in the system variables——"Double-click—"New—"Copy the path of the bin folder of the MySQL installation directory—— "Three confirmations must be made to make the changes take effect
Whether the test is normal
normal