Home  >  Article  >  Database  >  How to install MySQL8.0 on Mac

How to install MySQL8.0 on Mac

coldplay.xixi
coldplay.xixiforward
2020-07-03 17:30:243325browse

How to install MySQL8.0 on Mac

1. Install a local mysql on mac

brew mysql install

2. After installing with brew An error occurs when starting mysql.

3. Check the error log
cat /usr/local/var/mysql/xxxxx.err

[ERROR] [MY-011011] [Server ] Failed to find valid data directory.
[ERROR] [MY-010020] [Server] Data Dictionary initialization failed.

Find the reason

  • mysql folder I created it myself.
    Delete this folder.

  • mysqld --initialize-insecure
    will create the required folders and files in the mysql data directory

  • Try to restart mysql again
    mysql.server start

##success

Related learning recommendations:

mysql Video tutorial

The above is the detailed content of How to install MySQL8.0 on Mac. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:learnku.com. If there is any infringement, please contact admin@php.cn delete