tags:

views:

475

answers:

3

My sys admin has me working on a server with Plesk, which requires me to have a unique username/password for each MySQL database I create. This is very annoying, does anyone know how to create a universal username login?

+1  A: 

This may be annoying but it is for better security. Universal Username and Login might be easier to remeber but not secure. If your system admin has done then it is done for reason.

Please usually allows you to create username and databases seperately. So you can use the same username for multiple batabases.

Shoban
A: 

Using GRANT syntax, you can give a single MySQL user account access to as many databases as you want, with the same password if you'd like.

GRANT ALL ON mydb.* TO 'user'@'localhost' IDENTIFIED BY 'password';
GRANT ALL ON mydbtwo.* TO 'user'@'localhost' IDENTIFIED BY 'password';

If you wanted to create a user that always has access to all the databases, very much like the root user, you can use syntax like this:

GRANT ALL ON *.* TO 'someuser'@'somehost' IDENTIFIED BY 'password';

It's not recommended to share the same username and password across projects, but you can definitely do it.

zombat
A: 

In addition to actually granting the user permissions via GRANT ALL, you'll need to add a record to the db_users table in the Plesk database. Using shell to see all databases, I found the plesk database was named psa. Lookup accountid from accounts and dbid from data_bases

INSERT into db_users VALUES('','username','accountid','dbid');