Installation, configuration and uninstallation of MySQL 8.0 in Windows environment

Installation, configuration and uninstallation of MySQL 8.0 in Windows environment

Software Version

  • Windows: Windows 10
  • MySQL: mysql-8.0.17-winx64.zip

Installation Steps

1. Configure environment variables

name:Path
value: C:\Program Files\MySQL\mysql-8.0.17-winx64\bin

2. Create a new my.ini file

File location: C:\Program Files\MySQL\mysql-8.0.17-winx64\my.ini
(This is my installation directory, you can modify it according to your actual installation path)

[mysqld]
# Port number (default: 3306)
port=3306
# Set the installation directory of mysql basedir=C:\Program Files\MySQL\mysql-8.0.17-winx64
# Set the storage directory of mysql database data datadir=C:\Program Files\MySQL\mysql-8.0.17-winx64\data
# Maximum number of connections allowed max_connections=1000
# Maximum waiting time (non-interactive connection: jdbc connection database)
wait_timeout=60
# Maximum wait time (interactive connection: mysql client)
interactive_timeout=600
# Set the default time zone default-time_zone='+8:00'

The default port of mysql-8.0 is 3306 and the encoding is utf8mb4, so there is no need to set it again.

3. Run the command prompt as an administrator

// 1. Initialize the MySQL database C:\Program Files\MySQL\mysql-8.0.17-winx64\bin> mysqld --initialize --console
// If "initializing of server has completed" appears, or if many files are generated in the data folder, it means that the initialization is successful. // A random password will be displayed on the console after root@localhost: // 2. Install MySQL service C:\Program Files\MySQL\mysql-8.0.17-winx64\bin> mysqld install
// If you do not use the default service name, enter mysqld install mysql8.0 and specify the service name as mysql8.0
// If "Service successfully installed." appears, or there is a MySQL service in the service, it means that the installation is successful. // 3. Start the MySQL service C:\Program Files\MySQL\mysql-8.0.17-winx64\bin> net start mysql
// Start mysql with the specified service name: net start mysql8.0

// 4. At this point, the installation is complete. You can log in and try. The password is the random password generated when the database is initialized. C:\Program Files\MySQL\mysql-8.0.17-winx64\bin> mysql -uroot -p
// Start mysql on the specified port: mysql -uroot -P3305 -p

// 5. Change the root passwordmysql> alter user 'root'@'localhost' identified by 'root';

Uninstallation tutorial

1. Run the command prompt as an administrator

// 1. Stop MySQL
D:\ProgramFiles\MySQL\mysql-8.0.16-winx64\bin> net stop mysql
// Stop mysql with the specified service name: net stop mysql8.0

// 2. Uninstall MySQL
D:\ProgramFiles\MySQL\mysql-8.0.16-winx64\bin>mysqld remove
// Uninstall mysql with the specified service name: mysqld remove mysql8.0

2. Open the registry: run -> regedit, delete the following directories

HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Eventlog\Application\MySQL
HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/Eventlog/Applications/MySQL

Errors and solutions

1. Error: Install/Remove of the Service Denied!

Solution: Run the command line as an administrator

Summarize

The above is the installation, configuration, uninstallation and data migration of MySQL 8.0 in Windows environment introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!
If you find this article helpful, please feel free to reprint it and please indicate the source. Thank you!

You may also be interested in:
  • MySQL 8.0.16 installation and configuration tutorial under Windows 10
  • MySQL 8.0.16 installation and configuration method graphic tutorial under Windows
  • Solve the problems encountered when installing mysql-8.0.11-winx64 in Windows environment
  • Tutorial diagram of installing MySQL service through MySQL Installer under Windows
  • MySQL installation tutorial under Windows with pictures and text
  • Graphic tutorial on installing the latest version of MySQL server on Windows 7 64 bit
  • MySQL 8.0.11 Community Green Edition Installation Steps Diagram for Windows
  • Completely uninstall MySQL database in Windows system to reinstall MySQL
  • MySQL 5.7.10 installation and configuration tutorial under Windows
  • Ubuntu 16.04.1 MySQL installation and uninstallation graphic tutorial
  • How to install and uninstall MySQL service under Windows (MySQL 5.6 zip decompression version installation tutorial)
  • How to install and uninstall MySQL 5.7.11 on Mac

<<:  Vue implements a simple timer component

>>:  How to use Vue3 asynchronous data loading component suspense

Recommend

How to Use rsync in Linux

Table of contents 1. Introduction 2. Installation...

Getting Started: A brief introduction to HTML's basic tags and attributes

HTML is made up of tags and attributes, which are...

Docker image import, export, backup and migration operations

Export: docker save -o centos.tar centos:latest #...

Alibaba Cloud Centos7 installation and configuration of SVN

1. Install SVN server yum install subversion 2. C...

XHTML Web Page Tutorial

<br />This article is mainly to let beginner...

Solution to the problem of invalid width setting for label and span

By default, setting width for label and span is in...

Detailed explanation of TypeScript's basic types

Table of contents Boolean Type Number Types Strin...

Example code for implementing a QR code scanning box with CSS

We usually have a scanning box when we open the c...

Detailed installation instructions for the cloud server pagoda panel

Table of contents 0x01. Install the Pagoda Panel ...

Methods of adaptive web design (good access experience on mobile phones)

1. Add the viewport tag to the HTML header. At th...

Detailed explanation of the data responsiveness principle of Vue

This article is mainly for those who do not under...

How to prohibit vsftpd users from logging in through ssh

Preface vsftp is an easy-to-use and secure ftp se...