MySQL 8.0.12 installation and environment variable configuration tutorial under win10

MySQL 8.0.12 installation and environment variable configuration tutorial under win10

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:

  • Developer Default
  • Server only
  • Full installation
  • Custom

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:
  • MySQL 5.6.23 Installation and Configuration Environment Variables Tutorial
  • How to configure environment variables after installing mysql5.7 database
  • The latest version of MySQL 8.0.22 download and installation super detailed tutorial (Windows 64 bit)
  • MySQL 8.0.22.0 download, installation and configuration method graphic tutorial
  • MySQL 8.0.22 download, installation and configuration method graphic tutorial
  • Detailed tutorial for downloading, installing and configuring MySQL 5.7.27
  • mysql8.0.20 download and installation and problems encountered (illustration and text)
  • MySQL 5.6.37 (zip) download installation configuration graphic tutorial
  • MySQL 5.7.18 Green Edition Download and Installation Tutorial
  • MySQL 8.0.15 download and installation detailed tutorial is a must for novices!
  • MySQL 8.0.13 download and installation tutorial with pictures and text
  • Summary of common problems in downloading and installing MySQL 5.7 on Win7 64-bit
  • Detailed graphic instructions for downloading and installing the unzipped version of MySQL 5.7.18 and starting the MySQL service
  • MySQL 5.7 Service Download and Installation Graphical Tutorial (Classic Edition)
  • MySQL 5.7.14 download, installation, configuration and use detailed tutorial
  • MySQL msi version download and installation detailed graphic tutorial for beginners

<<:  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

Recommend

Vue image cropping component example code

Example: tip: This component is based on vue-crop...

MySQL fuzzy query statement collection

SQL fuzzy query statement The general fuzzy state...

How to display div on object without being blocked by object animation

Today I made a menu button. When you move the mous...

Detailed explanation of some settings for Table adaptation and overflow

1. Two properties of table reset: ①border-collaps...

Django+mysql configuration and simple operation database example code

Step 1: Download the mysql driver cmd enters the ...

Detailed explanation of the use of bus in Vue

Vue bus mechanism (bus) In addition to using vuex...

Implement a simple search engine based on MySQL

Table of contents Implementing a search engine ba...

Example code for implementing dynamic skinning with vue+element

Sometimes the theme of a project cannot satisfy e...

How to operate json fields in MySQL

MySQL 5.7.8 introduced the json field. This type ...

MySQL 5.7.18 free installation version configuration tutorial

MySQL 5.7.18 free installation version installati...

Use JS to zoom in and out when you put the mouse on the image

Use JS to zoom in and out when the mouse is on th...

How to monitor global variables in WeChat applet

I recently encountered a problem at work. There i...

Time zone issues with Django deployed in Docker container

Table of contents Time zone configuration in Djan...

Detailed tutorial for installing mysql 8.0.12 under Windows

This article shares with you a detailed tutorial ...