MySQL install and configure the most detailed tutorial

Outline

MySQL as the method most commonly used database, manually installed or slightly curved

First, download the installation package ( official website ) enter the page can not log on. Click the bottom of the "No thanks, just start my download ." To start the download.

installation:

Unzip the package directly to the path you want to install to, the equivalent of no installation, I can see the extraction path in the D drive ROUTE folder mysql8 folder, drawing the red line under the Date folders and my. ini file is not present when the decompression, I will not speak here, I will speak later when I installed, create a my.ini file in the unzipped folder, where code is as follows:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
[mysqld] 
# set port 3306
Port = 3306
# Set mysql installation directory
basedir = D: \\ \\ mysql8 ROUTE # here can also be used with a single slash double slash, some people will misuse single slash he try to know the
# set the storage directory data mysql database
datadir = D: \\ ROUTE \\ \\ mysql8 the data # here above
# allow the maximum number of connections
max_connections = 200
# allowed number of connection failures. This is to prevent someone from trying to attack the database system from the host
max_connect_errors = 10
# character set the server uses the default is UTF8
Character-the SET-Server = utf8
default storage engine that will be used when # create a new table
default-storage-engine = INNODB
# default "mysql_native_password" plug-in authentication
default_authentication_plugin = mysql_native_password
[mysql]
# mysql client to set the default character set
default-character-the sET utf8 =
[client]
# set the port to connect the server using the default mysql client
port =3306
default Character-the SET-utf8 =
[WinMySQLAdmin]
Server = D: \ ROUTE \ mysql8 \ bin \ mysqld.exe
# mysql service is set to add to the registry, anyway, I did not add this sentence initialization problem, directory Zhaomaohuahu, single parallel bars to choose their own

Nothing to say about the 3360 port, MySQL default port may be occupied, you can modify the port.
Then I wrote the above path is the relative path on the computer, second place (D: \ ROUTE \ mysql8 \ Data) Date refers to the file at the next initialization self-created folder, you do not change, I will follow Besides do it again. Then save it.

Configuration environment variable

Then let's configure the environment variables
right this computer and select Properties and then click on the "Advanced System Settings" click the environment variable to find the path in the system variable, tap path and then click on "Edit" and then point to New, and then point to browse directories point selection bin file OK on ok, then so determined to save when you quit, the environment variable configuration is successful.










Database initialization

Next, initialize the database

Find cmd, where you want to run as an administrator, how does it work?
We open the run (by win and R together), enter cmd carriage return can be seen that says C: \ Windows \ System32 \ cmd.exe then we find this path, the right to run as an administrator on the ok (of course you can also directly cmd in the search box and then right as administrator to run on the line, there is not demonstrated). then open to the bin directory: If it is not the C drive, such as my D drive, we must first enter D: because from cd command to use the C drive to another disk after disk must first go to the other and enter the cd ROUTE \ mysql8 \ bin if you open it with a cd in the C drive directly in accordance with the above form and enter the mysqld -initialize -console Note that mysqld not mysql is not a two horizontal cross, there is a space behind the word! And then enter this process takes about 30 seconds to display it renderings above, the contents of the box three display is fixed, the order also fixed, maybe no problem multi-display, the display must have a little problem, warning just a warning, do not have error and then be sure to remember here! ! ! ! ! ! ! @localhost: the next few strange characters are initialized password, do remember, or else forget the password to change the password of a lot of trouble! ! ! ! See Figure do not understand the word! ! ! !




















Continue entering mysqld -install
Note: mysqld not mysql, with a space, not a two horizontal cross! ! ! I demonstrated this side is removed, and then the installation, as shown above is displayed on the basic're done

Then we close the black cmd window (do not forget your password! Password !!! password !!!), and then re-open a new cmd window as an administrator as you have previously entered net start mysql command to open the mysql service and then enter mysql -u root -p to access the database, which will let you enter a password! ! ! ! !





change Password

Then change a password easy to remember
to continue to enter the alter user 'root' @ 'localhost'identified with mysql_native_password by' new password ';
pay attention! ! ! ! ! The above sentence is not case-sensitive, but the password seems to distinguish! But still we have to sign symbols written in English, because I used the Chinese failed. . . . and also! ! ! ! End of the sentence in English semicolon see, no less! ! !

carry out

This time even completed.

Note: If you have problems will be error, search for yourself to fully solve their own problems

Guess you like

Origin www.cnblogs.com/mxdon/p/11324619.html