[kwlug-disc] Bone headed mysql question (conflicting databases)

unsolicited unsolicited at swiz.ca
Wed Mar 28 22:54:41 EDT 2012


Remind me ... a MySQL server can run many databases, each of which can 
have many tables? Thus 'wordpress.*' below is all the tables in the 
wordpress database? [I'm assuming each database is a different (set of?) 
physical file.]

So ... one set of user 'definitions' per database.

Would an alternative be to run a 2nd server on a different port pointing 
to different files?

Or is this just as problematic as asking a user to sign in to different 
apps (since to the user it's an app, not a back end, or a database) with 
different userids? (Keeping the right port numbers in the right app, let 
alone it's 'this' password in 'that' app, and it's 'that' password in 
'this' app., for the same userid.)


On 03/28/2012 4:08 PM, Charles M wrote:
 > That solved all the problems ... thanks Chris!

On 03/22/2012 10:10 AM, Chris Irwin wrote:
> 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.




More information about the kwlug-disc mailing list