skip to Main Content

I have reinstalled Mysql via homebrew on Mac OS Sonoma 14.6.1 and when I try to run:

sudo mysql.server start

I get the following error message:

2024-10-09T09:13:17.6NZ mysqld_safe Logging to '/usr/local/var/mysql/.err'.
2024-10-09T09:13:17.6NZ mysqld_safe Starting mysqld daemon with databases from /usr/local/var/mysql
2024-10-09T09:13:17.797714Z 0 [System] [MY-015015] [Server] MySQL Server - start.
2024-10-09T09:13:17.982937Z 0 [System] [MY-010116] [Server] /usr/local/opt/mysql/bin/mysqld (mysqld 9.0.1) starting as process 17933
2024-10-09T09:13:17.985396Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /usr/local/var/mysql/ is case insensitive
2024-10-09T09:13:17.993893Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2024-10-09T09:13:18.012828Z 1 [ERROR] [MY-012592] [InnoDB] Operating system error number 2 in a file operation.
2024-10-09T09:13:18.012865Z 1 [ERROR] [MY-012593] [InnoDB] The error means the system cannot find the path specified.
2024-10-09T09:13:18.012874Z 1 [ERROR] [MY-012594] [InnoDB] If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them.
2024-10-09T09:13:18.012884Z 1 [ERROR] [MY-012646] [InnoDB] File ./ibdata1: 'open' returned OS error 71. Cannot continue operation
2024-10-09T09:13:18.012897Z 1 [ERROR] [MY-012981] [InnoDB] Cannot continue operation.
2024-10-09T09:13:18.6NZ mysqld_safe mysqld from pid file /usr/local/var/mysql/.pid ended
2024-10-09T09:13:21.6NZ mysqld_safe Logging to '/usr/local/var/mysql/.err'.
2024-10-09T09:13:21.6NZ mysqld_safe Starting mysqld daemon with databases from /usr/local/var/mysql
2024-10-09T09:13:21.271166Z 0 [System] [MY-015015] [Server] MySQL Server - start.
2024-10-09T09:13:21.454371Z 0 [System] [MY-010116] [Server] /usr/local/opt/mysql/bin/mysqld (mysqld 9.0.1) starting as process 18039  
2024-10-09T09:13:21.456889Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /usr/local/var/mysql/ is case insensitive  
2024-10-09T09:13:21.456917Z 0 [ERROR] [MY-010123] [Server] Fatal error: Please read "Security"   section of the manual to find out how to run mysqld as root!  
2024-10-09T09:13:21.457157Z 0 [ERROR] [MY-010119] [Server] Aborting  
2024-10-09T09:13:21.457538Z 0 [System] [MY-010910] [Server] /usr/local/opt/mysql/bin/mysqld: Shutdown complete (mysqld 9.0.1) Homebrew.
2024-10-09T09:13:21.457543Z 0 [System] [MY-015016] [Server] MySQL Server - end.  
2024-10-09T09:13:21.6NZ mysqld_safe mysqld from pid file /usr/local/var/mysql/.pid ended  

I have tried to reinstall it from scratch 3 times now. I have also tried to change ownership of /usr/local/var/mysql to mysql:mysql but that have not solved the problem. I have also tried to delete the folder /usr/local/var/mysql and all of its content before reinstalling mysql.

When I try to run:

sudo mysql.server start

With the old content of my mysql folder (not a fresh install), I get the following error:

2024-10-09T09:33:14.6NZ mysqld_safe Logging to '/usr/local/var/mysql/erik-mac.err'.   
2024-10-09T09:33:14.6NZ mysqld_safe Starting mysqld daemon with databases from /usr/local/var/mysql   
2024-10-09T09:33:14.811122Z 0 [System] [MY-015015] [Server] MySQL Server - start.   
2024-10-09T09:33:14.993247Z 0 [System] [MY-010116] [Server] /usr/local/opt/mysql/bin/mysqld (mysqld 9.0.1) starting as process 42946   
2024-10-09T09:33:14.995678Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /usr/local/var/mysql/ is case insensitive   
2024-10-09T09:33:14.995704Z 0 [ERROR] [MY-010123] [Server] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!   
2024-10-09T09:33:14.995929Z 0 [ERROR] [MY-010119] [Server] Aborting   
2024-10-09T09:33:14.996300Z 0 [System] [MY-010910] [Server] /usr/local/opt/mysql/bin/mysqld: Shutdown complete (mysqld 9.0.1)  Homebrew.   
2024-10-09T09:33:14.996304Z 0 [System] [MY-015016] [Server] MySQL Server - end.   
2024-10-09T09:33:15.6NZ mysqld_safe mysqld from pid file /usr/local/var/mysql/erik-mac.pid ended   

2

Answers


  1. Chosen as BEST ANSWER

    I downgraded to Mysql 8.4 and then manually started mysql server by using the command:

    sudo /usr/local/opt/mysql/bin/mysqld --user=root

    This seemed to have solved my problem?


  2. The instructions are clearly listed in Homebrew’s usual caveats section. If that doesn’t display on your machine, you need to find out why. Running brew doctor would be a good place to start.

    If it does display and you just didn’t bother to read it, you can display it again by running brew info mysql; it will display the information again without having to reinstall it.

    In your situation:

    1. Reset (or delete) all files and folders that you have changed ownership of
    2. Run brew doctor and fix whatever it says – you may have forgotten something.
    3. Do a brew reinstall mysql just to be sure
    4. Read the complete output of that command!
    5. Start mysql normally, for example by running brew services mysql start
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search