Jump to content



  • Please log in to reply
3 replies to this topic

#1 9AF

  • Members
  • Pip
  • Newbie
  • 8 posts

Posted 21 February 2003 - 02:26 AM

I have recently started to work on MySQL, PHP and apache and I\'m still finding my way round. Having installed apache 2.0.44 (successfully), with MySQL 4.0 and PHP 4.3.2 I found this script which is suppose to help show that all works with PHP/MySQL. The code is:

mysql_connect($host, $user, $password);
$db_table = mysql_list_dbs();
for ($i = 0; $i < mysql_num_rows($db_table); $i++) {
echo(mysql_tablename($db_table, $i));

However, I keep on getting this error:

Warning: mysql_connect() [function.mysql-connect]: Access denied for user: \'rb@\' (Using password: YES) in C:Program FilesApache GroupApache2htdocstest.php on line 8
mysql test

Is this test that I\'m trying to do valid? If so what have I done wrong. Any feedback would be much appreciated.



#2 pallevillesen

  • Members
  • PipPipPip
  • Advanced Member
  • 135 posts
  • LocationDenmark

Posted 21 February 2003 - 09:54 AM

It\'s not your test, it\'s your access that is the problem...

You probably have a special password set for the user pj@localhost...

That\'s the error anyway... Try and connect with

mysql -h localhost -u pj -p buzz from a terminal window...

And/Or browse the mysql:user table...

Hope this helps,
Palle Villesen, www.birc.dk [br]Bioinformatics Research Center

#3 shivabharat

  • Members
  • PipPipPip
  • Advanced Member
  • 371 posts
  • LocationChennai, India

Posted 21 February 2003 - 02:59 PM

Check the my.ini file and u will see the password u have set.
Knowledge --- Reading Enriches Mind But Sharing Enhances It.[br][br]Note: Before you request help enusre that you have had a look at the tutorials @phpfreaks

#4 9AF

  • Members
  • Pip
  • Newbie
  • 8 posts

Posted 22 February 2003 - 11:19 AM

Thanks for the responses. I have managed to solve the problem by using user \'root\' and a password set to user \'root\'. The PHP code runs fine now. Though I did set a user and a password using mysqladmin for some reason nothing happened (defnitely something to do with permissions). In the documentation it does state somewhere to use user \'root\' when first using a new installation of MySQL as it has all the permissions set already.

Thanks again for your help its much appreciated.


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users