Linux > Plesk

How to assign multiple database users to another database?

(1/1)

vichithrakumart:
You can use database utility to add the user to the existing database:


--- Code: ---# plesk bin database --update <db_name> -add_user <db_user> -passwd <password>
--- End code ---


--- Code: ---db_name1 db_user1 password1
db_name2 db_user2 password2
db_name3 db_user3 password3
--- End code ---


The 1st column is database name on the database server where it is required to add database user.
The 2nd column is a name of a database user.
The 3rd column is a password of a database user.

After this, connect to the server via SSH and run the utility in a loop taking the data from /root/db_user.list file:

--- Code: ---# cat /root/db_user.list | while read var1 var2 var3 ; do plesk bin database --update $var1 -add_user $var2 -passwd $var3 ; echo user $var2 - success; done
--- End code ---

   


Navigation

[0] Message Index

Go to full version