PDA

View Full Version : Connecting to the database.



jgkiefer
03-12-2004, 07:16 PM
Could someone please walk me through the steps to connect a program to the mysql database? I keep getting errors and I realy want to ubderstand.

Here goes...
In phpmyadmn I creat a database called newdb.

Now in my php application I fill in the

Database host = localhost

Database username = root (I'm guessing)

Database password = ? (Where do I set this)

Database name = newdb (Is this correct, or is there a path to be used here like mydomain_newdb)

I am confused and would really appriciate help in understanding this.

wildjokerdesign
03-12-2004, 07:25 PM
Your password should be the same as the one for you main account. Most likely the one you use to log in to phpMyAdmin and/or your site manager. That is if you let the defaults go through when you set things up. Your other choices look right to me.

What errors are you getting? If you continue to have problems knowing the errors you get might help us figure out what is going on.

FZ
03-13-2004, 07:27 AM
What are the errors you are getting?

"root" is the correct username for mySQL, but as for password, you should have entered one when you installed mySQL via your Site Manager (assuming you are on WestHost 2.0). If it is not the same as your account password, you can see what it is by having a look at the my.cnf file in the /etc directory (via FTP or SSH) to see what your password is.