Home  >  Article  >  Database  >  What should I do if mysql does not have a data folder?

What should I do if mysql does not have a data folder?

WBOY
WBOYOriginal
2022-05-26 17:06:117805browse

In mysql, you can use the "mysqld --initialize-insecure --user=mysql" command to solve the problem; this command can automatically create a data folder in the bin directory of the MySQL installation directory. This folder Used to store database information.

What should I do if mysql does not have a data folder?

The operating environment of this tutorial: windows10 system, mysql5.7 version, Dell G3 computer.

What should I do if mysql does not have a data folder?

When installing mysql 5.7 version, if you find that the data folder is missing due to the root directory,

Do not copy other versions data folder

Because this operation will cause many potential problems: For example, when executing the show variables like "%charact%"; statement, the error table does not exist!

Open the cmd command window and enter the bin directory of the mysql installation directory.

Then enter the command (note: there is a space in front of all --. It is recommended to copy directly, do not enter the command yourself to prevent losing the space):

mysqld --initialize-insecure --user=mysql

Then press Enter; Go to the directory and check that the data folder has been automatically created.

Problem Solving

What should I do if mysql does not have a data folder?

Recommended learning: mysql video tutorial

The above is the detailed content of What should I do if mysql does not have a data folder?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn