MySQL 5.7 decompressed version installation, uninstallation and garbled code problem graphic solution

MySQL 5.7 decompressed version installation, uninstallation and garbled code problem graphic solution

1. Installation of the decompressed version

(1). Download the compressed package and unzip it to a disk location

Compressed package download link: https://dev.mysql.com/downloads/mysql/

Compressed file contents:

這里寫圖片描述

(2). Write configuration files

Copy my-default.ini and rename it to my.ini, then modify or add configuration information:

[mysqld]
#mysql decompression directory basedir = <decompression directory>
#data folder location, used to store libraries and tables datadir = <data folder directory>
#mysql default port number port = 3306
#Database server character encoding character-set-server = utf8

(3). Add environment variables

Add the bin directory to the PATH environment variable

(4). Install MySQL service

Run cmd as an administrator, command:

mysqld -install [service name]

Note: The service name is usually MySQL by default, so you don’t need to specify it.

When the prompt: Service successfully installed. is displayed, it means that the MySQL service has been successfully installed.

(5). Initialize MySQL

Run cmd as an administrator, command:

mysqld --initialize-insecure

No prompts or errors. If you can see "MySQL" in the system's "Services", the installation is successful.

(6). Start the MySQL service

Run cmd, command:

net start mysql

Tip: MySQL service is starting and MySQL service has started successfully. Indicates successful startup

(7). Log in to MySQL

Run cmd, command:

mysql –u root –p

(When initializing MySQL, a computer name.err file will be generated, which contains the initialization password)

2. Uninstall the unpacked version of MySQL

(1) Shut down the service

Run cmd as an administrator, command:

net stop mysql

(2). Uninstall service

Run cmd as an administrator, command:

mysqld -remove [service name]

(3) Deleting files

Delete the mysql installation directory

(4). Delete registry information

Clear the MySQL service in the registry. There are several places:

Delete the directory HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Eventlog\Application\MySQL. Delete the directory HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\Services\Eventlog\Application\MySQL. Delete the directory HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application\MySQL.

The ControlSet001 and ControlSet002 in the registry are not necessarily 001 and 002, they may be ControlSet005, 006, etc. You can delete them all.

3. Common installation issues

(1). Data file error

Error description: When starting the mysql service, the prompt is:

The mysql service cannot be started. The server did not report any errors. Type NET HELPMSG 3534 for more help.
Cause of error: This error will occur if the data file already exists before initialization, or if some files are missing from the data file.

Solution: Execute the command first:

mysqld -remove [service name]

Then delete the data folder. If you cannot delete it, just restart it. Then reinstall it and there will be no problem.

(2). Wrong password

Error description: When logging in:

ERROR 1045(28000): Access denied for user 'root'@'localhost' (using password: YES)

Cause of error: Wrong password during login

Solution: Using the mysqld –initialize method to install will generate a password consisting of a random string. This password can be found in the error log <mysql decompression directory>\data\<computer user name>.err.

4. Coding Issues

(1). Check the code

Open cmd, log in to mysql, and execute SQL statements:

show variables like 'character%';

It can be seen that except for the character-set-server = utf8 configured at the beginning of the installation; the others are not utf8 encoding, so garbled characters will appear when we use the database.

(2). Modify the configuration file

Modify these items in the configuration file:

[mysqld]
#mysql server encoding character-set-server = utf8
collation-server = utf8_general_ci
[mysql]
#mysql default encoding default-character-set = utf8
[mysql.server]
#Server default encoding default-character-set = utf8
[mysqld_safe]
default-character-set = utf8
[client]
#Client default encoding default-character-set = utf8

(3). Delete your current MySQL service and re-register the MySQL service

Run cmd as administrator:

sc delete mysql

Tip: [SC] DeleteService is successful

mysqld –install

Tip: The service already exists! Success

net stop mysql

Tip: MySQL service is stopping... Success if the service name is invalid

mysql –install

Tip: Service successfully installed.

Open cmd, log in to mysql, and execute SQL statements:

show variables like 'character%';

The results are as follows:

這里寫圖片描述

Done!

5. Install the graphical interface

(1). Install all the way through next, then start

The above is the graphic solution to the installation, uninstallation and garbled code problems of the decompressed version of MySQL 5.7 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!

You may also be interested in:
  • Detailed steps for completely uninstalling and reinstalling MySQL under Windows 10
  • MySQL uninstall and install graphic tutorial under Linux
  • Installation and uninstallation of MySQL 5.7 decompressed version and summary of common problems
  • Detailed explanation of installing and completely uninstalling mysql with apt-get under Ubuntu
  • How to uninstall MySQL 5.7.19 under Linux
  • Several methods to completely uninstall MySQL under CentOS
  • How to completely uninstall MySQL, Apache2 and Php in Ubuntu
  • Detailed tutorial on MySql installation and uninstallation
  • How to completely delete and uninstall MySQL in Windows 10
  • Diagram of the process from uninstallation to installation of MySQL 5.7.18 yum under Linux
  • Uninstalling MySQL database under Linux
  • Complete steps for uninstalling MySQL database
  • Analysis of the reasons why the mysql-libs* crontab command that comes with Linux 6.7 cannot be used after uninstallation
  • Ubuntu 16.04.1 MySQL installation and uninstallation graphic tutorial
  • Detailed explanation of completely uninstalling mysql under Linux
  • 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
  • Detailed steps for completely uninstalling MySQL 5.7

<<:  In-depth interpretation of /etc/fstab file in Linux system

>>:  Nine advanced methods for deduplicating JS arrays (proven and effective)

Recommend

Web designer's growth experience

<br />First of all, I have to state that I a...

Detailed steps for installing rockerChat in docker and setting up a chat room

Comprehensive Documentation github address https:...

Linux loading vmlinux debugging

Loading kernel symbols using gdb arm-eabi-gdb out...

How to install mysql5.6 in docker under ubuntu

1. Install mysql5.6 docker run mysql:5.6 Wait unt...

How to implement horizontal bar chart with percentage in echarts

Table of contents Example Code Rendering Code Ana...

What are the benefits of using B+ tree as index structure in MySQL?

Preface In MySQL, both Innodb and MyIsam use B+ t...

JavaScript function detailed introduction

Any number of statements can be encapsulated thro...

7 native JS error types you should know

Table of contents Overview 1. RangeError 2. Refer...

Vue.$set failure pitfall discovery and solution

I accidentally found that Vue.$set was invalid in...

JavaScript code to implement Weibo batch unfollow function

A cool JavaScript code to unfollow Weibo users in...

Node implements search box for fuzzy query

This article example shares the specific code for...

Web form creation skills

In fact, the three tables above all have three ro...

MySQL 5.7.17 installation and configuration graphic tutorial

The blogger said : I have been writing a series o...

MySQL import and export backup details

Table of contents 1. Detailed explanation of MySQ...

Use of Linux dynamic link library

Compared with ordinary programs, dynamic link lib...