I'm a relative newbie. I can make MySQL databases and tables and display dynamic tables on webpages. I'm about ready to publish my first database online. But I need to go back and get squared away on usernames and passwords.
First, I'm going to run into a problem if my local username/password is star/stardust, but I want to use this database on sites with two different webhosts, which gave me the username riskybiz and laidoff, respectively.
So could I replace the username and password with echo functions? 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");
But, going back to square one, I need to get a grip on the basics first. 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
geoblue_savior@%
root@%
root@localhost
testuser@localhost
I created geoblue_savior@% and testuser@localhost; 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 (in this particular case) 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, given the following?
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
geoblue_savior@%
root@%
root@localhost
testuser@localhost
And what global privileges should I use?
My final question is simple: How do you add and modify usernames and passwords with phpMyAdmin? I could have sworn I'd seen an option for changing passwords many times, but I can't find it now. It looks like I can do it with Navicat, but I'm going to be in trouble when my free trial runs out!
Thanks.





Bookmarks