1. The default user table sets up root with no password. Leave out the password and
it will probably connect OK. You really need to fix the user table, but as long as
the system isn't accessible from outside, you can get by.
2. You don't need to use "host", in this case 127.0.0.1, when connecting from the
same machine. It doesn't hurt, but it may add confusion at some future point in your
3. All of this is really mysql specific and you would do better using that list, too.
On Sun, 22 Jun 2003 00:45:12 +1000, David wrote:
>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
>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:
>$conn = mysql_connect("127.0.0.1","root","password","databasename");
>if (!$conn) die ("Could not connect");
>which gives this result:
>Warning: Access denied for user: '[EMAIL PROTECTED]' (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?
>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
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php