Why is my permission denied when I try to create a MySQL database?
I am root user on my computer, 开发者_如何学JAVAbut when I use the command:
mysql> CREATE DATABASE foo;
it gives me error:
CREATE: Permission denied
It's because your user doesn't have the CREATE
privilege. As the root user, try this:
GRANT CREATE ON *.* TO 'user'@'hostname';
It doesn't matter who are you for the system, if you want to login in mysql as root you have to do it explicitly:
mysql -u root –p
精彩评论