Newb question PHP/mySQL

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Tekmosis
Forum Newbie
Posts: 1
Joined: Sat Jan 11, 2003 8:09 pm

Newb question PHP/mySQL

Post by Tekmosis »

I'm runnin PHP/mySQL on my PC as of right now using Apache. The thing that stumps me is on some php code that I've seen/tested it uses

Code: Select all

$server = "localhost";
$db_user = "username";
$db_pass = "password";
$database = "database";
Now how do I know what my username/pass is? I havn't set anything except when I first installed mySQL in which I had done "mySQLadmin -u root password yourpassword" yet no user name. How would I set a user name and would I use the password I set when I did the "mySQL -u root password yourpassword"? Help would be much appreciated
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

oldtimer
Forum Contributor
Posts: 204
Joined: Sun Nov 03, 2002 8:21 pm
Location: Washington State

Post by oldtimer »

You have to add a database and give it a username and password.
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Re: Newb question PHP/mySQL

Post by twigletmac »

Tekmosis wrote:..."mySQLadmin -u root password yourpassword" yet no user name. How would I set a user name and would I use the password I set when I did the "mySQL -u root password yourpassword"? Help would be much appreciated
You do already have one username - root - that is automatically setup when MySQL is installed and it would appear that you've also set a password for it so if you use those two in combination you should be good to go.

Mac
Post Reply