At 7:22 -0700 6/2/04, David Blomstrom wrote:
I've been studying MySQL for a few weeks now and am
about ready to publish some databases online. But I'm
confused about usernames and passwords. I understand
you can create usernames and passwords on three or
four different levels, like root, database, etc. As I
understand it, "localhost" is the standard platform on
which all the databases rest.

No.

You can assign *privileges* at four levels: global, database,
table, column.  These are stored in the user, db, tables_priv,
and columns_priv tables in the mysql database.

Privileges are associated with user accounts.  An account
is defined as a host + user value combination.  These are
stored in the Host and User columns of the user table,
along with any global privileges the account has.  The account
password is stored in the Password column of the user table.


I believe all my databases have the same setting - localhost, newbie_user, Newbie

Those aren't my real username and password, of course.
But I THINK newbie_user and Newbie are the username
and password for localhost, and none of my databases
have usernames or passwords. So how do I create one?

Databases don't have passwords. Accounts do. The accounts can be assigned database-level privileges.


I thought I remembered seeing the password command in
phpMyAdmin, but I can't find it now.

Can't help you there. However, I suggest that if you want to know how the MySQL access control system works, you read the relevant sections of the MySQL Reference Manual. I would not try to intuit it from how phpMyAdmin works.

http://dev.mysql.com/doc/mysql/en/Privilege_system.html
http://dev.mysql.com/doc/mysql/en/User_Account_Management.html



And if I create a database username and password on top of a localhost username and password, am I going to have to log in with two usernames and passwords?

Then again, I could be mistaken about the localhost
username and password; it might be that newbie_user
and Newbie are a DATABASE username and password shared
by all my databases.

It sounds like your conceptual model is backwards. It might serve you best to toss out that model and read through the sections of the manual noted above.

--
Paul DuBois, MySQL Documentation Team
Madison, Wisconsin, USA
MySQL AB, www.mysql.com

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to