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

Analysis of parameter transfer process of driver module in Linux

Declare the parameter name, type and permission y...

Linux sftp command usage

Concept of SFTP sftp is the abbreviation of Secur...

Examples of MySQL and Python interaction

Table of contents 1. Prepare data Create a data t...

How to deploy zabbix_agent in docker

zabbix_agent deployment: Recommendation: zabbix_a...

How to achieve seamless token refresh

Table of contents 1. Demand Method 1 Method 2 Met...

Detailed explanation of WeChat Mini Program official face verification

The mini program collected user personal informat...

Javascript implements simple navigation bar

This article shares the specific code of Javascri...

How to use dd command in Linux without destroying the disk

Whether you're trying to salvage data from a ...

Practical MySQL + PostgreSQL batch insert update insertOrUpdate

Table of contents 1. Baidu Encyclopedia 1. MySQL ...

How to install docker on centos

Here we only introduce the relatively simple inst...

JS implements a simple todoList (notepad) effect

The notepad program is implemented using the thre...

MySQL uses events to complete scheduled tasks

Events can specify the execution of SQL code once...