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

Methods for defragmenting and reclaiming space in MySQL tables

Table of contents Causes of MySQL Table Fragmenta...

A brief analysis of how to upgrade PHP 5.4 to 5.6 in CentOS 7

1. Check the PHP version after entering the termi...

8 examples of using killall command to terminate processes in Linux

The Linux command line provides many commands to ...

Implementation of Nginx operation response header information

Prerequisite: You need to compile the ngx_http_he...

Correct way to load fonts in Vue.js

Table of contents Declare fonts with font-face co...

Web page comments cause text overflow in IE

The experimental code is as follows: </head>...

Pricing table implemented with CSS3

Result: Implementation Code html <div id="...

Automatic backup of MySQL database using shell script

Automatic backup of MySQL database using shell sc...

MySql COALESCE function usage code example

COALESCE is a function that refers to each parame...