mysql> create database test; ERROR 1006 (HY000): Can't create database 'test' (errno: 2)

后端 未结 4 2177
迷失自我
迷失自我 2021-01-05 14:32

I can\'t create a database after logging in mysql under my root account. Do I have to make an admin account to do so? Also, for some reason, my StartUp file didn\'t install

4条回答
  •  情深已故
    2021-01-05 15:03

    If you're on macosx and if you've system preference pane installed, that should show a message like

    the following directory is not owned by _mysql user - "/usr/local/msyql/data"
    

    Once you know that path you can do the following:

    sudo chown -R mysql:mysql /usr/local/mysql/data
    
    sudo chown -R mysql:mysql 
    

提交回复
热议问题