|
-
Apr 20th, 2002, 09:00 PM
#1
Thread Starter
Stuck in the 80s
Simple PHP/MySQL ?
I'm just starting with MySQL. I created a database and a table, then found an example script to use with the table, however I don't know what to put for the host?
PHP Code:
mysql_connect(???, root);
-
Apr 20th, 2002, 09:05 PM
#2
Member
localhost...I've only had to use an server name once.
-
Apr 20th, 2002, 09:41 PM
#3
Thread Starter
Stuck in the 80s
I tried that at first (that's what the example had) but then I got a whole mass of errors:
Warning: Access denied for user: 'root@localhost' (Using password: NO) in /home/vbshelf/public_html/test.php on line 13
Do I need a password or something?
-
Apr 20th, 2002, 09:46 PM
#4
Thread Starter
Stuck in the 80s
I got it to connect, but now I have a few more errors to work with.
I had to change root to vbshelf_root.
-
Apr 21st, 2002, 04:43 AM
#5
Fanatic Member
PHP Code:
mysql_connect(???, root);
well, my ROOT password doesnt have a password, and i use this to connect:
PHP Code:
mysql_connect(LOCALHOST, root);
, i'm not sure about abbreviations and stuff, i cant check @ the moment cos i'v just got a new pc and cant get my other HDD running on it yet, it has my whole page on it and every PHP script i have
-
Apr 21st, 2002, 10:50 AM
#6
PowerPoster
you should never leave root having no password, for obvious reasons.
This should work fine
PHP Code:
// initialise database variable
$db = mysql_connect("localhost", "username", "password");
-
Apr 21st, 2002, 04:42 PM
#7
Thread Starter
Stuck in the 80s
Originally posted by The Hobo
I got it to connect, but now I have a few more errors to work with.
I had to change root to vbshelf_root.
Yeah, I'm past that, thanks.
I guess my server requires the domain to be put before everything. So if the user is 'root', it requires 'vbshelf_root' and if the data base is 'bing', it requires 'vbshelf_bing.'
Thanks for the help.
-
Apr 21st, 2002, 07:55 PM
#8
Thread Starter
Stuck in the 80s
Originally posted by chrisjk
you should never leave root having no password, for obvious reasons.
How do I set the password for root?
-
Apr 21st, 2002, 10:55 PM
#9
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|