connect to db with php?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Warning - beginner  :-)  I'm new at Linux, php and mysql, so please go slowly.

I have a test database with a couple of tables, etc., that I can connect to 
and run simple queries against, etc., all from the command line. I do most 
things as root, probably because I didn't set it up right and haven't fixed 
it.

I'm trying to put together a simple php script to connect to the database and 
learn about both at the same time. At the moment I have something like this:

<?php
$conn = mysql_connect("127.0.0.1","root","password","databasename");
if (!$conn) die ("Could not connect");
blah blah
?>

which gives this result:
Warning: Access denied for user: 'root@localhost.localdomain' (Using password: 
YES) in /var/www/html/php/script1.php on line 9
 (line 9 is the $conn line, above)

I've tried a few variations but I'm not sure where to go from here.
Can anyone help out?
thanks
David

-- 


The arm folds in at the elbow, not out


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux