Lou Olsten wrote, "You do not have to put a user into the system for every location from which you want to connect. Instead, you can use wildcards like: GRANT .... ON *.* to 'Newbie'@'196.168.168.%'
or maybe 'Newbie'@'%.yourdomain.com'" I don't know how to work with wildcards, but are you describing something I could also do with echo statements? It's a pain in the butt using the same database on two different websites with different usernames and passwords, like david_works and japan_works. For example, one of my webpages begins with the following code: <?php @mysql_connect ("localhost" , "testuser" , "TestUser"); @mysql_select_db ("world"); Could I replace that with this?: <?php $username = 'webhost_testuser'; $password = 'webhost_pass'; $database = 'world'; @mysql_connect ("localhost" , "' . $username . '" , "' . $password . '"); @mysql_select_db ("database"); --- Paul DuBois <[EMAIL PROTECTED]> wrote: > 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. . . . > >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 Hmmmm... to make this easier to understand, let me break this down into three sections: 1. What system do I have in operation now? 2. What system SHOULD I have? 3. How do I get there? I put some screen shots from a program called Navicat online at http://www.geoworld.org/userpass.gif In picture #1, you see my eight databases listed on the left. The tables inside database "world" are listed on the right. When I click "Manage Users," I see the following: %localhost [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] I created [EMAIL PROTECTED] and [EMAIL PROTECTED]; one or more of the others are default usernames. Picture 5 illustrates that all eight databases appear inside each user's folder. So users can be thought of as people, and each of these people has access to each database, right? Note the note at the bottom of picture 6: "No privileges are currently set for the selected option." So that's what I have. Now, what SHOULD I have? I'm the only person using my computer. I don't envision anyone else working with my databases, unless I create some tables that visitors can add information to using PHP add/edit forms. I'm going to have at least two major databases, one focusing on geography, the other on animals. I'll have others, but these will do as an example. Since I'm presently the only user, which of the following should/could I discard? In other words, let's say I choose "minx" as a new username, allowing me to discard testuser. And "minx" gives me access to both the World and Animals databases. Can I discard all the other usernames, or should I retain one or more? %localhost [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] And what global privileges should I use? I think I've answered the third question; it looks like I can add and delete users with Navicat (so I'm going to have to buy it! :) Thanks. __________________________________ Do you Yahoo!? Friends. Fun. Try the all-new Yahoo! Messenger. http://messenger.yahoo.com/ -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]