Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install mysql 8.0.12 in Windows environment

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article will explain in detail how to install mysql 8.0.12 in the Windows environment, the content of the article is of high quality, so the editor will share it with you for reference. I hope you will have some understanding of the relevant knowledge after reading this article.

I. installation

1. Download the MySQL8.0.12 version from the official website and download the link

two。 Unzip it to a folder after download

My decompression path: C:\ Program Files\ MySQL8.0.12

Put the compressed folder on disk D, and you can't go to the specified folder through cmd. Put it on disk C and there will be no problem. )

3. File configuration

First, create a new my.ini file through notepad under the decompressed path

The contents are as follows:

[mysqld] # set port 3306 port=3306# set mysql installation directory basedir=C:\ Program Files\ MySQL8.0.12# set the data storage directory of mysql database datadir=C:\ Program Files\ MySQL8.0.12\ Data# allow the maximum number of connections max_connections=200# allows the number of connections to fail. The character set used by the max_connect_errors=10# server defaults to the default storage engine default-storage-engine=INNODB# that UTF8character-set-server=utf8# will use when creating new tables using the "mysql_native_password" plug-in authentication # mysql_native_passworddefault_authentication_plugin=mysql_native_ password [MySQL] # setting the mysql client default character set default-character-set=utf8 [client] # setting the default port port=3306default-character-set=utf8 when the mysql client connects to the server

4. Database configuration

Enter cmd with administrator privileges and go to the bin directory of the MySQL installation, and the instructions are as follows:

Then type mysqld-- initialize-- console, and the following screen appears, in which the red box is the initial password of the database root user (be sure to remember or save it! ), you need to log in later. If you accidentally turn it off or don't remember, delete the data directory generated by initialization and execute the initialization command again and regenerate it.

Then type mysqld-- install to install the mysql service

Enter net start mysql to start the service (Note: mysqld-- remove is to uninstall the MySQL service, and net stop mysql is to stop the service. )

5. Enter the configuration of the database

Type mysql-u root-p, and then you will be asked to enter the password, which is the password you were asked to remember. After entering it correctly, the following interface will appear, indicating that you have entered the MySQL command mode. (the last digit of my password is the lowercase letter l. I thought it was the number 1. I tried several times to find it.)

Then change the password and enter ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY' new password; the following interface indicates that the change is successful. (note: there is a semicolon at the end, all of which are below)

At this point, the MySQL8.0.12 database installation is complete.

II. Database-related configuration

View the default database directive: show databases

Select mysql database directive: use mysql

View the default MySQL user directives: select host, user, authentication_string, plugin from user

Create a new user: CREATE USER 'username' @ 'host name' IDENTIFIED WITH mysql_native_password BY 'password'; (the username and password are set to be easy to remember, and the username I set is leo. )

Authorize new users: GRANT ALL PRIVILEGES ON *. * TO 'user name' @ 'host name'; refresh permission: FLUSH PRIVILEGES

Well, MySQL8.0.12 has been successfully installed on Windows and has created its own users. You can close the cmd window. You don't need it. Next, use the database graphical tool to use database programming.

Connect to the Navicat database visualization tool

Share an installation-free Navicat Premium 12:

After downloading, unzip it to a disk, and I decompress it to disk D.

Locate the directory where the file is located and open the program as shown in the following figure:

After opening, the interface of the software is:

Create a new MySQL connection:

Click on the connection test to see if the connection is successful.

On how to install mysql 8.0.12 in the Windows environment to share here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report