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

后端 未结 4 2191
迷失自我
迷失自我 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:12

    You have one root user for several domains. Meaning you can connect and run queries on that database FROM the specified domains.

    If you want to only show one, give it '%' for the domain and remove all others, although that is not advised. Save the root user for run rights only from localhost, and create limited users for running queries from outside.

    As for test database error, it happens on fresh installs. Just reboot the mysql server(stop/start process) or the computer.

    Also, make sure you have full rights by doing

    GRANT ALL PRIVILEGES ON *.* TO 'root'@'thedomainyourunfrom/localhost/%' WITH GRANT OPTION;
    

    this will give your root user full rights across all databases in the server

    osx manual http://dev.mysql.com/doc/mysql-macosx-excerpt/5.0/en/macosx-installation.html

提交回复
热议问题