Forum Moderators: coopster
I follow an example in my book to test.
Php code:
<?php
echo mysql_connect ('localhost', 'username', 'password');
?>
And the output on the browser is:
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'username'@'localhost' (using password: YES) in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\mysql_test.php on line 2
Can anyone help? Thank you.
FYI, phpinfo.php loads fine but also without information about "MySQL"
Are you changing password, host and username to values that will work with the database?
Actually, I don't remember setting up a username or host. I only remember setting a password.
Maybe a firewall blocking port 3306?
Try logging into mysql manually through the command line with the same credentials to see if you still have the same problem. Also, which version of mysql are you running?
Welcome to MySQL monitor....
The MySQL version is 5.0.45-community-nt MySQL Community Edition. I am using windows xp.
mysql_connect ('localhost', 'root', '<password>');
the root password is probably what you set.
Try this then:mysql_connect ('localhost', 'root', '<password>');
the root password is probably what you set.
It works. You are pro. Thank you.
But why when I run phpinfo.php, I cannot see the information table for MySQL? Is there something I need to change in the php.ini file for it to display this info?