Windows MySQL 8.0 is the easiest to install and configure_Northern Crescent Blog-CSDN Blog
Linux MySQL 8.0 installation and configuration_Northern Crescent's Blog-CSDN Blog
Table of contents
1. Download MySQL from the official website
5. Environment variable configuration
8. MySQL update tutorial example (can be collected and used later)
Don't worry that this tutorial will be outdated, MySQL Server can be upgraded to the latest version at any time
0. Uninstall MySQL (if any)
Before installing, make sure whether MySQL has been installed on the computer before ?
! ! ! The most important step in the whole article! ! !
80% of installation problems are due to this reason
Recommend two blogs, I will not write them here
The solution to the failure of MySQL installation starting the server
Or see if there is such a path
If so, please search online for tutorials
1. Stop the service 2. Delete the registry 3. Delete the installation directory and data directory (if there is a data directory)
It's best to restart the system when you're done.
If there is any deletion residue, it may cause problems with subsequent installations
Start reading this tutorial again
1. Download MySQL from the official website
MySQL :: Download MySQL Installerhttps://dev.mysql.com/downloads/installer/
This is just an installer, there is a 64-bit MySQL Server in the installation package
Here let us log in to the account, ignore it, and download it directly
Of course, if the download speed is too slow, you can also use my link 2023.7.13 to update.
mysql-installer-community-8.0.33.0
mysql-installer-community-8.0.33.0.msi
MD5: 9b4ce33ab05ae7e0aa30a6c4f1a4d1c2
At this time, if you install it directly, you will find that it is installed to C:\Program Files\MySQL by default, and does not give you a path choice
MySQL if
- The installation package will be installed to the C drive and there is no path selection. (Of course, if the system is only divided into one drive, please ignore it)
- If the compressed package is decompressed, the configuration file can be configured, and the installation can be decompressed to the specified path.
Most of the tutorials on CSDN are to decompress and install MySQL . It is very troublesome to configure files
The graphical interface installed by the installation package can help update MySQL and other database drivers to the latest version (not for decompressed installation)
2. Preparatory work
Updated July 13, 2023. No need to prepare for work now
3. Start the installation
Double-click the installation package
We choose custom installation, because some applications we may not use
Select the service to install and click the arrow to add it to the right
(If you want to install others later, refer to the update at the end of the article, just select ADD)
Updated on 2/23/2022
(If you don't have this question, just skip it!)
If you install this Check Requirements here
It means that your system lacks the C++ library required by MySQL , just install it
click execute
Agree, continue to install
It will be OK later
check this option
Pay attention to this very small button, he did his best to prevent us from changing the path
Just modify it
NEXT
execute install wait for it to finish installing
Click NEXT
4. Configure MySQL Server
This interface can be defaulted, do not touch it , click Next
The official recommendation is the first one, we will use the first one
Be careful! ! If we want to use database graphical tools later (navicat example)
If the navicat version is too old, such as 11, a database connection error will occur
It is recommended to choose the second password option or upgrade the version of the software graphical tool
If you are learning MySQL, just take an easy-to-remember password (forgetting the password is troublesome)
This can be changed to MySQL, which is more convenient when starting the service
Updated July 13, 2023
Pick the last one and continue
Then continue to install
The installation is complete, click FINISH
go back outside
FINISH to exit the installation
If you want to modify the configuration just now, you can come here
5. Environment variable configuration
At this time, everyone opens the command line and directly enters mysql
It should be an error, because we haven't configured the environment variable yet, so we can't use the mysql command directly
Open our installation directory, go to the MySQL Server 8.0\bin directory,
Copy this entire line of address
1. Right-click Properties of This Computer
2. Open the advanced system settings (I am win11, win10 should be on the left or right)
3. Environment variables
4. Find the PATH of the system variable, double-click to enter the edit
5. Create a new one, paste the path you just copied
6. Note that you must click OK layer by layer to exit!
Click until this page
6. Change time zone and
(If you don't want to learn java, you can ignore this step first)
Change the time zone (learning JAVA and using JDBC will cause time zone problems, so you need to change it to the East Eighth District)
Check this first under win10 to find the ProgramData folder
Go to ProgramData\MySQL\MySQL Server 8.0
(Not necessarily on the D drive like me, if you can’t find this file, it is recommended to use everything to search globally)
down to find
[mysqld]
Add this sentence below
default-time_zone='+8:00'
and save
After closing, restart mysql to take effect
If it has not been started, it will take effect after it is turned on, so there is no hurry
continue down
7. Verify the installation
win + s search for cmd or powershell, right click to start with administrator
Verify the command line just configured (4th header)
enter
mysql -uroot -p
re-enter password
In the start menu interface, you can see these extra things
If there is no option to install workbench above, there will be no
Click the command line that comes with MySQL (MySQL command line client)
Verify it, it worked
Take a look at the GUI interface
GUI interface can help you update MySQL and other database interface drivers to the latest version
8. MySQL update tutorial example (can be collected and used later)
Update on January 21, 2022: As shown in the picture, I can upgrade the server version, echoing the beginning doge(
Click to upgrade
Check the option to upgrade
Wait for the download to complete
As shown in the picture, all are up-to-date and keep pace with the times (don't worry that this tutorial will be outdated, because you can upgrade to the latest version)
Please indicate the source: