One of the possible reasons:
MYSQL has already been opened, and an error is reported when it is opened again in the terminal:
check whether
the database is enabled by default.
Possible errors such as:
- use terminal commandsudo mysql.server restartTurn it back on:
- Error:
… ERROR! The server quit without updating PID file (/usr/local/var/mysql/MacBook-Air.local.pid).
- or error
ERROR! MySQL server PID file could not be found!
- entermysqlOrder:
- Error:
ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: NO)
MacB
When you close the opening of the location database as shown in the figure, and then enter the command in the terminal to start it, you can start it successfully.
as the picture shows: