Installing MySQL 8.0.12 based on Windows

Installing MySQL 8.0.12 based on Windows

This tutorial is only applicable to Windows systems. If you have installed it but not yet installed it, be sure to delete the original database first, execute: mysqld --remove mysql, and then read my post!

Step 1: Download the installation package from the MySQL official website

Step 2: Unzip the downloaded installation package (mysql-8.0.12-winx64.zip) to the corresponding path. It is recommended to install it in a disk with larger space. (My installation path is: D:\mysql-8.0.12-winx64) Be sure to remember the installation directory here! !

Step 3: Create a new configuration file in the installation directory and name it my.ini (Please note that I encountered the biggest trouble when installing it, which was not specifically mentioned in previous experience posts. To create a configuration file, first create a new text document in the folder you unzipped, and then change the format. Be sure to change the txt extension to .ini). See below for details:

The most critical step is here: copy and paste the following content in my.ini (copy it all):

[mysql]
; Set the mysql client default character set default-character-set=utf8
[mysqld]
; Set port 3306 port = 3306
; Set the installation directory of mysql basedir=D:\Software\Programming Software\Database\MySQL\mysql-8.0.12-winx64
; Set the storage directory of mysql database data datadir=D:\Software\Programming Software\Database\MySQL\mysql-8.0.12-winx64\data
; Maximum number of connections allowed max_connections=200
; The default character set used by the server is the 8-bit latin1 character set character-set-server=utf8
; The default storage engine that will be used when creating a new table default-storage-engine=INNODB

Step 4: Run the cmd.exe command line tool as an administrator:

Right-click Command Prompt and select Run as Administrator

Step 5: Execute the following command to go to the bin directory of the MySQL installation directory:

#Enter the MySQL installation directory:
cd /d D:\mysql-8.0.12-winx64\bin
(Do not copy and paste directly here, because the folders we create may not be the same, so be sure to check your own installation directory)

#Execute the command to install MySQL:
mysqld install

#Execute the following command to initialize the data directory (after 5.7, you must execute this command before you can start mysql)
mysqld --initialize-insecure

#Execute the following command to start mysql
net start mysql 

Step 6: Configure the password for the root account:

#Execute the following command to log in to mysql. You do not need to enter a password for the first login. Just press Enter. mysql -u root -p 

#After successful login, execute the following command to change the password (change newpassword to the password you set):
alter user 'root'@'localhost' identified with mysql_native_password by 'newpassword';
#After changing the password, execute the following command to refresh the privileges:

Step 7: Congratulations! mysql has been installed!

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:
  • Windows10 mysql 8.0.12 non-installation version configuration startup method
  • Detailed tutorial for installing mysql 8.0.12 under Windows
  • MySQL 8.0.12 decompression version installation graphic tutorial under Windows 10
  • MySQL 8.0.12 installation and configuration method graphic tutorial (Windows version)
  • MySQL 8.0.12 installation and configuration method graphic tutorial (windows10)
  • How to install and configure MySQL 8.0.12 decompressed version under Windows 10 with graphic tutorials

<<:  Understand the implementation of Nginx location matching in one article

>>:  Solution to JS out-of-precision number problem

Recommend

js realizes the magnifying glass function of shopping website

This article shares the specific code of js to re...

Detailed explanation of MySQL master-slave database construction method

This article describes how to build a MySQL maste...

A detailed introduction to deploying RabbitMQ environment with docker

Prerequisites: Docker is already installed 1. Fin...

Understand the principles of MySQL persistence and rollback in one article

Table of contents redo log Why do we need to upda...

Detailed explanation of JavaScript timers

Table of contents Brief Introduction setInterval ...

Analysis of mysql view functions and usage examples

This article uses examples to illustrate the func...

Summary of 4 solutions for returning values ​​on WeChat Mini Program pages

Table of contents Usage scenarios Solution 1. Use...

SQL implementation of LeetCode (178. Score ranking)

[LeetCode] 178.Rank Scores Write a SQL query to r...

Analysis of Context application scenarios in React

Context definition and purpose Context provides a...

Web page production TD can also overflow hidden display

Perhaps when I name this article like this, someon...

Simple usage example of vue recursive component

Preface I believe many students are already famil...

Detailed explanation of the seven data types in JavaScript

Table of contents Preface: Detailed introduction:...

Solution to the Multiple primary key defined error in MySQL

There are two ways to create a primary key: creat...