MySQL 5.7 installation and configuration tutorial

MySQL 5.7 installation and configuration tutorial

This article shares the MySQL installation and configuration tutorial for your reference. The specific contents are as follows

1. Configure MySQL database

1. Unzip the green version of mysql and rename it to mysql5.7, as shown below

Compare the previous versions of Figure 5.6 below, which lack the data directory (storing data) and the my-default.ini file (configuration information)

2. Installation Service

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

2. For the new version of MySQL 5.7, there is no data directory. We need to run the command to create it.

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

If you don’t need mysql, just run mysqld –remove to remove it, as shown below

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

If you need to configure whether to start MySQL at boot time, you can configure it in Windows Services.

3. Client Test

1.mysql –uroot –p as shown below

4. Change username and password

1. Run the command

use mysql;

UPDATE user SET authentication_string=password('123456') where user='root';

FLUSH PRIVILEGES;

As shown below:

2. Log in again and run the command mysql -uroot -p123456

5. Configure encoding to UTF-8

1. View the default encoding

2. In the root directory of mysql5.7, create a new my.ini file (this file does not exist after 5.7, create it yourself), as shown below:

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

3. Edit my.ini

Under the [mysqld] node, configure the server encoding and add two items

character_set_server=utf8

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

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

[mysql]

default-character-set=utf8

As shown below:

6. Test query

1. After modifying the configuration file, you must restart the service first

2. Log in as root user normally

3. Run the command show variables like "%character%" to view the system character set variables, as shown below:

Wonderful topic sharing: Installation tutorials for different versions of MySQL Installation tutorials for various versions of MySQL 5.7

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:
  • Installation and configuration of MySQL 5.6 under Windows with screenshots and detailed instructions
  • MySQL 5.6 (Win7 64-bit) download, installation and configuration graphic tutorial
  • MySQL 5.5 installation and configuration method graphic tutorial
  • MySQL 5.6.17 Green Edition (Free Installation) Installation and Configuration Tutorial
  • MySQL 5.7.16 installation and configuration method graphic tutorial
  • MySQL 5.7.13 installation and configuration method graphic tutorial (linux)
  • Installation and Configuration Tutorial of MySQL 5.6.11 for Windows
  • mysql5.7.19 winx64 decompressed version installation and configuration tutorial
  • MySQL 5.7.19 installation and configuration method graphic tutorial (win10)
  • MySQL 5.7.13 winx64 installation and configuration method graphic tutorial

<<:  jQuery implements time selector

>>:  Detailed explanation of Linux commands and file search

Recommend

MySQL query learning basic query operations

Preface MySQL is the most popular relational data...

How to quickly install Nginx in Linux

Table of contents What is nginx 1. Download the r...

Detailed steps for setting up and configuring nis domain services on Centos8

Table of contents Introduction to NIS Network env...

CSS inheritance method

Given a div with the following background image: ...

Detailed explanation of CSS3+JS perfect implementation of magnifying glass mode

About a year ago, I wrote an article: Analysis of...

Vue project implements file download progress bar function

There are two common ways to download files in da...

SQL ROW_NUMBER() and OVER() method case study

Syntax format: row_number() over(partition by gro...

8 essential JavaScript code snippets for your project

Table of contents 1. Get the file extension 2. Co...

mysql5.7.21 utf8 encoding problem and solution in Mac environment

1. Goal: Change the value of character_set_server...

Two implementations of front-end routing from vue-router

Table of contents Mode Parameters HashHistory Has...

How to underline the a tag and change the color before and after clicking

Copy code The code is as follows: a:link { font-s...

Several ways to set the expiration time of localStorage

Table of contents Problem Description 1. Basic so...

1 minute Vue implements right-click menu

Table of contents Rendering Install Code Implemen...