Solution to the failure of MySQL service startup during MySQL 5.7.18 installation

Solution to the failure of MySQL service startup during MySQL 5.7.18 installation

MySQL is a very powerful relational database. However, some beginners encounter various difficulties during installation and configuration. I will not talk about the installation process here, but will talk about the configuration process. When you download MySQL from the official website, there are two formats: msi and zip. You can directly run the Msi installation, and unzip the zip file to your favorite directory address. When installing both of these, you need to configure them before you can use them. The following introduction mainly focuses on the default address of the msi format: C:\Program Files\mysql-5.7.18-win32.

one. After installation or decompression, you need to configure environment variables. The process is as follows: My Computer -> Properties -> Advanced System Settings -> Advanced -> Environment Variables. In System Variables, click Path and select Edit. Add "C:\ProgramFiles\mysql-5.7.18-win32\bin;" What needs to be noted here is that it is not covering! Also, it is best to add it at the very beginning. The British semicolon ";" cannot be omitted. (You can also insert it in the middle, but remember to add it after ";".)

two. Click the Start menu, search for cmd.exe, left-click and run as administrator. Be sure to run it as administrator! ! !

If you run cmd directly, when you enter mysqld -install, an error will appear due to insufficient permissions: Install/Remove of theService Denied!

When you correctly enter mysqld –install and press Enter, it will display The service already exists!

three. Then enter net start mysql to start the server. If it shows that the server startup failed, as shown in the figure below.

This is because in versions 5.7 and above, there is no data folder in the C:\Program Files\mysql-5.7+ directory. Here, remember not to copy the data folder of other versions of MySQL. Instead, enter mysqld--initialize-insecure --user=mysql in the window. Note that there is a space before the "--", then press Enter. (It takes half a minute to wait, depending on the speed of the computer)

(In the C:\ProgramFiles\mysql-5.7.18-win32 directory, there is no data folder. As shown below)

Note: In versions below 5.7, you need to modify my-default.ini in the C:\ProgramFiles\mysql-5.* directory. Right-click and edit.

basedir=……

datadir=…..

Modified to

basedir= C:\Program Files\mysql-5.*

datadir= C:\Program Files\mysql-5.*\data

That's it, where "C:\Program Files\mysql-5.*" is determined by the actual installation location

Four. In the C:\ProgramFiles\mysql-5.7.18-win32 directory, it shows that the data folder was created successfully.

After creating the data, enter mysqld –install and press Enter (if the startup is successful in step 3, you do not need to enter it again)

5. After the service is successfully started, you can log in, enter mysql -u root –p and press Enter. Enter password will appear. Since no login password is set, you don’t need to enter anything, just press Enter.

After pressing Enter, as shown below, the MySQL configuration has been successful!

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • Solve the problem of PhPStudy MySQL startup failure under Windows system
  • Perfect solution to MySQL common insufficient memory startup failure
  • Solution to MySQL initialization and startup failure in Docker
  • Solution to MySQL database innodb startup failure and inability to restart
  • Quick solution to MySQL service startup failure under CentOS 7
  • Reasons and solutions for the failure of Mysql/MariaDB startup due to the progress bar state
  • Sharing the problem of mysql startup failure caused by disk full
  • mysql startup failure problem and scenario analysis

<<:  Detailed explanation of JS browser storage

>>:  Windows Server 2016 Standard Key activation key serial number

Recommend

Implementation of built-in modules and custom modules in Node.js

1. Commonjs Commonjs is a custom module in nodejs...

Vue computed properties

Table of contents 1. Basic Examples 2. Computed p...

Detailed introduction to CSS priority knowledge

Before talking about CSS priority, we need to und...

Use of VNode in Vue.js

What is VNode There is a VNode class in vue.js, w...

Table shows the border code you want to display

Common properties of tables The basic attributes ...

Analysis of the Neglected DOCTYPE Description

doctype is one of them: <!DOCTYPE HTML PUBLIC &...

idea combines docker to realize image packaging and one-click deployment

1. Install Docker on the server yum install docke...

Tutorial on installing Tomcat server under Windows

1 Download and prepare First, we need to download...

React Hooks Usage Examples

Table of contents A simple component example More...

How to Delete Junk Files in Linux Elegantly

I wonder if you are like me, a programmer who arr...

Vue implements small search function

This article example shares the specific code of ...

A brief discussion on the optimization of MySQL paging for billions of data

Table of contents background analyze Data simulat...

Summary of javascript date tools

let Utils = { /** * Is it the year of death? * @r...