Link to home
Start Free TrialLog in
Avatar of Marthaj
MarthajFlag for United States of America

asked on

Creating/Changing users for multiple databases for MySql 5.7

I have a legacy Symfony application that utilizes MySql 5.7. It contains two databases. 

It appears in the coding they login using  two users/passwords with administrator privileges - root/somepassword and someuser@localhost for both of the databases.

 I find that a tad bit confusing. I get it and I don't get it. 

I want to use the same user/password for both databases and giving them full administrator privileges.  I know that's not a good practice but they are set globally so easy to change after testing and since I am unsure at this point it they login elsewhere using perhaps a third user. 

     Does this mean I need to add someone@localhost as a user as well as someuser/somepassword to each database. They would need full administrator privileges.


Below is what I used but it spit at me - I think it's the mydatabase.user 

UPDATE  actual_databasename.actual_username
  SET authentication_string = PASSWORD('newpassword') 
  WHERE User = 'actual_username';
    
  UPDATE mysql.actual_username SET Grant_priv='Y', Super_priv='Y' WHERE User='actual_username';
  FLUSH PRIVILEGES;

Open in new window

Any help appreciated.


ASKER CERTIFIED SOLUTION
Avatar of gr8gonzo
gr8gonzo
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Marthaj

ASKER

Thank you for responding. I was able to update both users with the new permissions for each database.