Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't create databases with a new user

Tags:

mysql

I made a new user and from root I run the command:

GRANT ALL PRIVILEGES ON db.* TO 'USER'@'localhost' IDENTIFIED BY 'PASSWORD';

But then when I want to create a new database from user USER it always says:

Acces denied for user 'USER'@'localhost' to database 'database_name'

I neved used databases, so can anyone help me on how to create a database ?

like image 855
Adrian Avatar asked Jun 23 '11 06:06

Adrian


People also ask

How do I allow users to create a database in MySQL?

mysql> CREATE USER 'linuxconfig'@'localhost' IDENTIFIED BY 'password_here'; Now it is time to grant permissions to our linuxconfig user so that it can create new databases. We will do this by granting them the CREATE permission with the following command. mysql> GRANT CREATE ON *.

Can not create database in MySQL?

This error means that your mysql server does not have enough free space. You need to check the file system size and please remove unwanted software(s) or installers or files.

How do you assign a user to a database?

Expand the database in which to create the new database user. Right-click the Security folder, point to New, and select User.... In the Database User - New dialog box, on the General page, select one of the following user types from the User type list: SQL user with login.

How do I grant permission to user in MySQL?

To GRANT ALL privileges to a user , allowing that user full control over a specific database , use the following syntax: mysql> GRANT ALL PRIVILEGES ON database_name. * TO 'username'@'localhost';


Video Answer


1 Answers

Try this

GRANT ALL PRIVILEGES ON *.* TO 'USER'@'localhost' IDENTIFIED BY 'PASSWORD';
like image 121
Shakti Singh Avatar answered Oct 16 '22 16:10

Shakti Singh