I have enabled Single Sign On, allowing users that I create to access phpMyAdmin. The problem is the created users see all created databases, not just their own databases as would have been ideal. Please help me fix this, so that users see ony their databases
In heastiaCP there is not very detailed control customization provided in UI, if you want this type of stuff then you have to set up this manually from SSH.
@awambua You need to ensure that the usernames and passwords for the databases you create are consistent. For example, if you have databases named abc_db1
and abc_db2
, both should be assigned the same username and password, like abc_user1
with the corresponding password.
Single Sign On creates it own user for each connection but I have never seen before it create access to more databases then needed
Thank you for the insights
Thank you for this. Earlier during installation I ran this code mysql -uroot
mysql > CREATE USER âmyrootusernameâ@âlocalhostâ IDENTIFIED BY âmyrootusername_passwordâ
mysql > GRANT ALL PRIVILEGES ON . TO âmyrootusernameâ@âlocalhostâ WITH GRANT OPTION
mysql > FLUSH PRIVILEGES// could it be the issue?
Thank you for this. Earlier during installation I ran this code mysql -uroot
mysql > CREATE USER âmyrootusernameâ@âlocalhostâ IDENTIFIED BY âmyrootusername_passwordâ
mysql > GRANT ALL PRIVILEGES ON . TO âmyrootusernameâ@âlocalhostâ WITH GRANT OPTION
mysql > FLUSH PRIVILEGES// could it be the issue? How can I undo this?
Youâre correct that SSO generates its login credentials. However, the method I referred to isnât related to SSO, it allows you to use the same username and password to access multiple databases.
To assign access to multiple databases using the same login credentials in MySQL, follow these steps:
- Connect to MySQL
- Create the User
CREATE USER 'myrootusername'@'localhost' IDENTIFIED BY 'myrootusername_password';
- Grant Access to Multiple Databases
GRANT ALL PRIVILEGES ON database1.* TO 'myrootusername'@'localhost';
GRANT ALL PRIVILEGES ON database2.* TO 'myrootusername'@'localhost';
â Repeat for additional databases as needed
4.Flush Privileges
FLUSH PRIVILEGES;
5. You can verify the userâs privileges by running:
SHOW GRANTS FOR 'myrootusername'@'localhost';
The best approach is to use the same username and password when creating the new database. This way, you can log in to phpMyAdmin and access all the databases at the same time.
Thank you. Let me try