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);
Printable View
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);
localhost...I've only had to use an server name once.
I tried that at first (that's what the example had) but then I got a whole mass of errors:
Do I need a password or something?Quote:
Warning: Access denied for user: 'root@localhost' (Using password: NO) in /home/vbshelf/public_html/test.php on line 13
I got it to connect, but now I have a few more errors to work with.
I had to change root to vbshelf_root.
well, my ROOT password doesnt have a password, and i use this to connect:PHP Code:mysql_connect(???, 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 :)PHP Code:mysql_connect(LOCALHOST, root);
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");
Yeah, I'm past that, thanks.Quote:
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.
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.
How do I set the password for root?Quote:
Originally posted by chrisjk
you should never leave root having no password, for obvious reasons.
well, i'd reccomend downloading the MySQL_GUI :D it is soo handy ;)