MySQL server start issues on Mavericks

后端 未结 4 891
没有蜡笔的小新
没有蜡笔的小新 2021-01-30 10:51

I am having difficulty using MySQL on my MacBook, I am trying to start my server using sudo mysqld_safe and this results in the following output:

14         


        
相关标签:
4条回答
  • 2021-01-30 11:18

    If you don't have any important data, the easiest would be to reinstall MariaDB from scratch (otherwise skip this step), e.g.

    mv /usr/local/var/mysql /usr/local/var/mysql.bak
    brew reinstall mariadb
    

    Then fix the permissions by:

    sudo chmod -R u+rwX,g+rwX,o-rwx /usr/local/var/mysql
    sudo chown -R $USER:_mysql /usr/local/var/mysql
    

    Restart MariaDB services by:

    brew services restart mariadb
    

    Consider configuring your MariaDB credentials by running:

    mysql_secure_installation
    

    Troubleshooting

    • In case it still doesn't work, check the logs for any further issues by:

      tail /usr/local/var/mysql/*.err
      
    • For example check if in old config file consist any invalid settings, as they may be not supported anymore.

    0 讨论(0)
  • 2021-01-30 11:30

    i fixed that by simply delete the ".err" file. Somehow the error log owned by "_mysql" and prevent mysqld zu start.

    0 讨论(0)
  • 2021-01-30 11:31

    In my case I had a similar problem on Mac OS 10.10 Yosemite. For some reason when I killed the mysql process manually it changed the ownership of the error log file /usr/local/var/mysql/rally.local.err to _mysql instead of caleb. Unlike the accepted solution above, the whole rest of my directory is owned by caleb, not _mysql.

    I fixed it by running sudo chown caleb /usr/local/var/mysql/rally.local.err

    For the record I guess the proper way to stop and start the mysql server in Yosemite is with /usr/local/var/mysql/mysql.server start|stop|restart.

    0 讨论(0)
  • 2021-01-30 11:38

    File permissions are definitely the cause of the issue. There are far better experts than me, but I recommend the following:

    Ensure your entire data directory is owned by the _mysql user with permissions drwxr-xr-x.

    In your case, it appears that your MySQL installation directory is your data directory. My data directory is in a subdirectory of the installation directory.

    You can probably get up and running by changing permissions per the command:

    sudo chown -R _mysql:admin /usr/local/var/mysql
    sudo chmod -R u+rwX,g+rwX,o-rwx /usr/local/var/mysql
    

    This may limit your dave account from accessing the mysql installation directory without sudo, so you may wish to tweak these permissions to include g+rwx if your dave user is a member of the admin group, which it appears to be. That tweak would be accomplished with:

    sudo chmod -R g+rwx /usr/local/var/mysql
    
    0 讨论(0)
提交回复
热议问题