Installation, configuration, startup, login and configuration of environment variables of MySQL under Windows 10 platform 1.1 Download the installation file from the official website of MySQL and configure MySQL Tip: During the installation process, Windows Firewall will pop up a prompt asking whether to allow hardware changes, click Yes. 360 Security Guard and other software will mistakenly report MySQL and other database files as Trojan programs. It is recommended to close 360 during the installation process and only keep the Windows Firewall. The MySQL installation process fails, often due to reinstalling MySQL. When uninstalling MySQL, the previous installation directory must also be deleted, usually in the program file folder. Also delete the MySQL DATA directory, possibly in your user folder, and reinstall it. First go to the download address Choose 32-bit or 64-bit according to your platform. Here we choose 32-bit Click on the circle download Click login At this time, enter the login interface and enter your username and password (the username is usually the email address used when registering the account). If you don't have an account, create one here (the process of creating an account is very simple). Before downloading, we are prompted to provide some information. Just fill it in. Just fill in the Submit form Then enter the download page Click Download Now and wait for the download to complete before running Wait a moment to enter the license agreement window Check I accept the license terms and click Next The options you see now are from top to bottom:
Select Customize, next Open the directory, click on the left to select MySQLserver 8,0,12-X64, etc., click the right arrow in the middle to add it to the right, next Click Execute and wait for a while Click next as shown Click next to configure Next enters the configuration window Use the default configuration next Select to use a stronger encryption method for verification and click next (this is not available in MySQL 5.x) After setting the server password, Click next, please remember our Windows services Name, here the service name is MySQL80 Click Execute Finish the configuration Enter the password, the default user is root Check the password is correct, next After clicking execute, wait a while and click finish Click next, click finish, and you are done. 1.2 Start MySQL service There are two main ways to start the MySQL service: The first one: Enter "services,msc" in the search box, press the enter key to confirm, find the MySQL service, double-click it to open the properties dialog box, and change the service status by clicking "Start" or "Stop". Second type: Enter "cmd" in the search bar, right-click the command prompt option, select Run as administrator, and enter "net start MySQL80" in the command prompt interface to start the MySQL service. Enter "net start mysql80" to stop the MySQL service. A few tips about the second approach: 1. Possible solutions for invalid server name: The "MySQL80" entered here is the name of the service we set when configuring MySQL. In the picture above, we can see that after setting the server password, click next and you will enter the Windows service window. At that time, our default service name was "MySQL80". Some reference books directly ask us to enter "net start MySQL". If readers copy it during actual operations, the service name may be invalid. If you forget the service name, you can press win+R to open the window and enter services.msc to find the mysql service name. 2. Possible solutions for system error 5 and access denied: Some students may use the shortcut key "Win+r" to open the command prompt interface, and then enter the startup statement. At this time, this prompt may appear. This is the result that we did not run as an administrator. At this time, please refer to the second startup method above. 1.3 Log in to MySQL database After starting the MySQL database service, there are two ways to log in to the database: The first one: Find the mysql folder in the program directory, open it and select MySql 8.0 Command Line Client, and enter the password. Second type: Enter "cmd" in the search box, open the window as an administrator, and enter in the DOS window cd C:\Program Files\MySQL\MySQL Server 8.0\bin (Note: If your MySQL files are in another directory, please enter the corresponding address) After pressing enter to confirm, you can connect to the MySQL database through the login command. The login command is: mysql -h localhost -u root -p After enter, the system will prompt enter password. At this time, enter the password you set during configuration. After enter confirmation, you will log in to the database and can start operating the database. As shown in the figure: The general command format for logging into the MySQL database is: mysql -h hostname -u root -p What needs to be explained here is that mysql is the login command, -h is followed by the host address of the server. Because our client and server are on the same machine, we enter localhost, and -u is followed by the login user name, which is root by default. -p means that a password (login password) is required afterwards. 1.4 About configuring the Path environment variable Many readers may find it troublesome to type cd C:\Program Files\MySQL\MySQL Server 8.0\bin every time they log in to MySQL. Is there a better way? This requires adding the MySQL bin directory to the system's environment variables. First, right-click "This Computer" on the desktop and select "Properties", click "Advanced System Settings" on the left, select the "Advanced" tab in the "System Properties" dialog box, and click "Environment Variables" After opening the "Environment Variables" dialog box, select the "path" variable in the system variable list and click "Edit". Some screenshots are as follows: In the Edit Environment Variable dialog box, click New, enter C:\Program Files\MySQL\MySQL Server 8.0\bin, and finally click OK to complete the configuration of the environment variable. At this time, you can directly use the MySQL command to log in to the database Wonderful topic sharing: MySQL different versions installation tutorial MySQL 5.7 installation tutorials for various versions MySQL 5.6 installation tutorials for various versions mysql8.0 installation tutorials for various versions The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: Nginx configuration based on multiple domain names, ports, IP virtual hosts
>>: Solve the problem of importing Web projects into Idea and publishing them to Tomcat
Example: tip: This component is based on vue-crop...
SQL fuzzy query statement The general fuzzy state...
Today I made a menu button. When you move the mous...
1. Two properties of table reset: ①border-collaps...
Step 1: Download the mysql driver cmd enters the ...
Vue bus mechanism (bus) In addition to using vuex...
Table of contents Implementing a search engine ba...
Sometimes the theme of a project cannot satisfy e...
This is the first time I used the CentOS7 system ...
MySQL 5.7.8 introduced the json field. This type ...
MySQL 5.7.18 free installation version installati...
Use JS to zoom in and out when the mouse is on th...
I recently encountered a problem at work. There i...
Table of contents Time zone configuration in Djan...
This article shares with you a detailed tutorial ...