[kwlug-disc] Bone headed mysql question (conflicting databases)
Chris Irwin
chris at chrisirwin.ca
Thu Mar 22 10:10:37 EDT 2012
On Thu, Mar 22, 2012 at 09:37, Charles M <chaslinux at gmail.com> wrote:
> grant all on wordpress.* to 'myuser'@'localhost' identified by
> 'SomeFunnyPassword';
> grant all on drupal.* to 'myuser'@'localhost' identified by
> 'AnEvenCrazierPassword';
>
> What happens is that when I execute the second grant it seems to mess
> up/deactivate the first database.
I believe MySQL users and passwords are not database specific. Thus
you're changing the same user's password in each grant command.
After running the above, did you try logging into the wordpress
database using the "AnEvenCrazierPassword" you specified on the grant
command for the drupal database?
According to the MySQL docs, the [identified by ...] clause is
optional. If you want to use a single account and password, you should
leave it off any 'grant' commands once the user account already
exists.
That would be the simplest solution. If you do want different
passwords for each database/site, you'll need to use different user
accounts as well.
--
Chris Irwin
<chris at chrisirwin.ca>
More information about the kwlug-disc
mailing list