MySQL 8.0.12 Installation and Configuration Tutorial

MySQL 8.0.12 Installation and Configuration Tutorial

This article records the detailed tutorial for installing and configuring MySQL 8.0.12. The specific contents are as follows

1. Download

Link: Download page

After selecting the system platform, click download (select 64 or 32 bits according to the system)

2. Configuration

1. After the download is successful, unzip the installation package to the location where you want to install it. I installed it in "D:\MySql\"

If the installation directory contains a data folder, delete it.

2. Add the bin directory to the environment variable PATH

3. Installation

1. Run cmd as an administrator

2. Enter the bin folder under the installation directory

3. Execute mysqld --initialize or mysqld --initialize-insecure --user=mysql

If the execution is successful, a data folder will be generated in the installation directory. Open the folder to find the .err file and open it with a text editor.

Search for "root", and the colon is followed by a randomly generated temporary password

4. Continue and enter mysqld --install

5. Check the installation and enter mysql --version

6. Start the MySQL service and enter net start mysql. PS: To stop the service, enter net stop mysql.

4. Client Testing

1.mysql –uroot –p as shown below

5. Change username and password

1. Create a new mysql-init.txt in the installation directory, enter ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass';, save

PS: For versions 5.7.5 and earlier, enter SET PASSWORD FOR 'root'@'localhost' = PASSWORD('MyNewPass');

2. Close the MySQL service, then enter the bin directory in cmd, enter mysqld --init-file=D:\MySql\mysql-8.0.12-winx64\mysql-init.txt, after the execution is complete, delete the mysql-init.txt file and restart the MySQL service

3. Enter mysql -u root -p, then enter the password to log in (if you cannot log in, enter the random password in .err to enter mysql and proceed to step 4)

4. After entering the mysql shell, retype the command in mysql-init.txt

Enter exit and log in again with the new password

5. Verify that MySQL is working properly

Type show databases;

Enter use mysql;

Input SELECT User,Host,authentication_string FROM user;

6. Configure encoding to UTF-8

1. View the default encoding

show variables like '%character%';

2. In the root directory of D:\MySql\mysql-8.0.12-winx64, create a new my.ini file (this file does not exist after 5.7, create it yourself), as shown below:

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


[mysqld]
default-character-set = utf8
character_set_server = utf8
[mysql]
default-character-set = utf8
[mysql.server]
default-character-set = utf8
[mysqld_safe]
default-character-set = utf8
[client]
default-character-set = utf

As shown below:

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

Client connection:

Navicat For MySQL

Error message: 1251- Client does not support authentication protocol requested by server; consider upgrading MYSQL

Solution:

1. Enter the unzipped MySQL root directory through the command line.

2. Log in to the database

mysql -uroot -p

3. Enter the root password again:

4. Change the encryption method:

ALTER USER 'root'@'localhost' IDENTIFIED BY 'password' PASSWORD EXPIRE NEVER;

5. Change password: In this example, 123456 is the new password

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456';

6. Refresh:

FLUSH PRIVILEGES;

Finally the connection was successful:

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.7.23 installation and configuration graphic tutorial
  • mysql 5.7.23 winx64 decompression version installation tutorial
  • MySQL 5.7.23 installation and configuration method graphic tutorial
  • MySQL 5.7.18 winx64 installation and configuration method graphic tutorial
  • MySQL 5.7.18 free installation version configuration tutorial
  • MySQL 5.7 and above version installation and configuration method graphic tutorial (mysql 5.7.12\mysql 5.7.13\mysql 5.7.14)
  • MySQL 5.7.14 installation and configuration method graphic tutorial
  • MySQL Server 8.0.3 Installation and Configuration Methods Graphic Tutorial
  • MySQL 8.0.12 installation and configuration method graphic tutorial (Windows version)
  • MySQL 5.7.23 winx64 installation and configuration method graphic tutorial under win10

<<:  Linux Domain Name Service DNS Configuration Method

>>:  Detailed explanation of SSH password-free login configuration under Linux

Recommend

Samba server configuration under Centos7 (actual combat)

Samba Overview Samba is a free software that impl...

How to migrate sqlite to mysql script

Without further ado, I will post the code for you...

MySQL master-slave synchronization principle and application

Table of contents 1. Master-slave synchronization...

Sample code for implementing two-way authentication with Nginx+SSL

First create a directory cd /etc/nginx mkdir ssl ...

How to configure path alias for react scaffolding

The react version when writing this article is 16...

Implementation of Docker container connection and communication

Port mapping is not the only way to connect Docke...

What is MIME TYPE? MIME-Types type collection

What is MIME TYPE? 1. First, we need to understand...

How to insert pictures into HTML pages and add map index examples

1. Image formats supported on the WEB: GIF: can s...

jQuery realizes image highlighting

It is very common to highlight images on a page. ...

MySQL master-slave replication configuration process

Main library configuration 1. Configure mysql vim...

Tutorial analysis of quick installation of mysql5.7 based on centos7

one. wget https://dev.mysql.com/get/mysql57-commu...

Summary of common functions of PostgreSQL regular expressions

Summary of common functions of PostgreSQL regular...

Ubuntu 18.04 obtains root permissions and logs in as root user

Written in advance: In the following steps, you n...