Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to reinstall mysql

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces how to reinstall mysql, which is very detailed and has a certain reference value. Interested friends must finish reading it!

How to reinstall mysql: first stop the mysql service, then go to the newly downloaded mysql directory, install the mysql service, and finally start the service and log in.

Event process

Stop the mysql service: net stop mysql

Go to the directory of the currently installed mysql, go to the bin directory, and uninstall the mysql service:

Cd C:\ Program Files\ mysql\ bin

Mysqld-remove

Enter the newly downloaded mysql directory and install the mysql service:

Mysqld-install

The service is installed successfully. Start the service and log in

Net start mysql

Mysql-u-root-p

The password is wrong. It is found that the installed service is still the old mysql service under disk C. the reason should be that the previous service has not been uninstalled cleanly.

Treatment process

Stop the mysql service

Net stop mysql

Uninstall the mysql service

Cd C:\ Program Files\ mysql\ bin

Mysqld-remove

Delete a file

Delete the entire folder C:\ Program Files\ mysql

Delete the registry

Start cmd- > enter regedit- > search for mySQL, and right-click to delete all (or find MySQL according to the following path, right-click to delete)

HKEY_LOCAL_MACHINE/SYSTEM/ControlSet001/Services/Eventlog/Applications/MySQL

HKEY_LOCAL_MACHINE/SYSTEM/ControlSet002/Services/Eventlog/Applications/MySQL

HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/Eventlog/Applications/MySQL

The above completes the complete uninstallation of the old mysql, and the following is the installation of the new mysql.

5. Download the green version of mysql and extract it

Address http://dev.mysql.com/downloads/mysql/

6. Create a my.ini profile

Create a my.ini configuration file in the unzipped directory with the contents

[mysql]

Default-character-set=utf8

[mysqld]

Basedir=D:\ Program Files\ MySQL\ mysql-5.7.11-winx64

Datadir=D:\ Program Files\ MySQL\ mysql-5.7.11-winx64\ data

Port=3306

Max_connections=200

Character-set-server=utf8

Default-storage-engine=INNODB

7. Go to the installation directory and install the service

Cd E:\ Program Files\ mysql\ bin

Mysqld-install (needs to be run as an administrator)

If the following prompt appears

Download VC redist packages for x64, download is complete, click run.

(address: https://www.microsoft.com/en-us/download/details.aspx?id=40784)

8. Initialize data

After the new version of mysql is decompressed, the installation directory does not have a data folder and needs to be initialized. * * Note that it cannot be created manually, * * because an initial root password is randomly generated at the beginning, and the initialization command is as follows:

Mysqld-initialize

Execute this command or default a password

Mysqld-initialize-insecure

Execute this command without a password by default.

At this point, the data folder is generated under the installation directory.

Enter the data file and open a .err-ending file with the initialization password in it.

9. Start the service and change the password

Net start mysql

Mysql-u root-p

Enter the initialization password

If there is no password, mysql-u root

10. Modify the password

Mysql > set password for root@localhost = password ('123')

The above is how to reinstall all the content of mysql, thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report