Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Initializing mysql directory error

Tags:

I checked this page: http://dev.mysql.com/doc/refman/5.7/en/mysql-install-db.html

mysql_install_db is removed, however, when I use mysqld --initialize. It promotes these errors and warning.

[Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).

[ERROR] --initialize specified but the data directory has files in it. Aborting.
[ERROR] Aborting

The first one can be ignored according to this:How to enable explicit_defaults_for_timestamp?

I don't know how to solve the second problem.

like image 834
Pay C. Avatar asked Jun 05 '16 16:06

Pay C.


People also ask

What should I initialize after installing MySQL?

After MySQL is installed, the data directory must be initialized, including the tables in the mysql system database: For some MySQL installation methods, data directory initialization is automatic, as described in Chapter 3, Postinstallation Setup and Testing.


1 Answers

Pls, read error carefully:

[ERROR] --initialize specified but the data directory has files in it. Aborting.

Your directory is not empty. You have to remove all the contents of it or choose another one.

like image 194
Eugene Lisitsky Avatar answered Sep 29 '22 17:09

Eugene Lisitsky