Home >Java >javaTutorial >MySQL configuration and installation (detailed graphic and text explanation)

MySQL configuration and installation (detailed graphic and text explanation)

怪我咯
怪我咯Original
2017-06-23 13:46:202513browse

1: Download MySQL

1. Enter the oracle official website

## 2.

3.

4.

##5.

6.

##7.

## URL:

2: Configure MySQL database 2.1 Unzip the green version of mysql and rename it to mysql5.7, as shown below

Compare the version before 5.6 in the figure below, which contains less data directory (data storage) and my-default.ini file (configuration information)

2.2 Installation service

1. Run cmd (administrator version, otherwise there is no permission), as shown below

 

2. For the new version of mysql5.7, there is no data directory, we need to run the command Create

​ ​

​ 3. Run the command mysqld –install to install the service, as shown below:

If you no longer need mysql, you only need to run mysqld –remove to remove it, as shown below

4. Run net start mysql to start the service, as shown below

2.3 Client test

2.3.1 MySQL – UROOT —P As shown below

2.3. 2 Change the username and password

1. Run the command

use mysql;

UPDATE user SET authentication_string=password('123456') where user='root'; // Modify the password to 123456

# Flush Privileges; // Refresh

As shown below:

2.3.3 Re -login, run commands mysql - uroot -p123456

                                                                                                                                                                                                                                                                                         # 2. In the root directory of mysql5.7, create a new my.ini file (this file is no longer available after 5.7, so create it yourself), as shown below:

                                       When the program starts, it will automatically read my.ini to obtain various configuration parameters, including encoding

3, edit my.ini

at the [MySQLD] node, configure the server code, add 2 items

caracter_Set_Server = UTF8

# [mysql] node node Yes, this is to configure the client information

We also add the [mysql] node and configure the encoding UTF8

[mysql]

default-character-set=utf8

                                                                                                                                                                            since the configuration file has been modified

                                                            

## 2. Use root user to log in

# 3. Run the command show variables like Set variables, as shown in the figure below:

Sely showing this configuration UTF-8 complete

#

The above is the detailed content of MySQL configuration and installation (detailed graphic and text explanation). For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn