Can't access MySQL via PHP

2001-11-03 Thread Imran Aziz

Hi all,

I have a MySQL database 'mydb' and I can perfectly access it via telnet. I
have one database and I have full access to it. I can't create user and
other databases, but its fine.

Problem is that I write a PHP script and I can't access my sql database
using that script! I got 'Access Denied' Error.

I've tried MySQL grant commands e.g.

Grant ALL PRIVILEGES
ON mydb.*
TO imran@%; (replaced % with my hostname etc. too)

command is executed properly.


Here is the PHP script:

include(passwords.php);
$openConn2db = mysql_connect( $hostname:$port, $username,$password );
$dbSelected = mysql_select_db( $dbname, $openConn2db );
$result = mysql_db_query ($dbname,select * from Girls);
while ($row = mysql_fetch_array ($result))
{
$sFace = $row[face];
print(trtdfont face='Arial' size='1'$sFace/font/td/tr);
}


How can I configure mysql so I can access it with my web applications too,
not just telnet?

And anyone knows how to make mysql accessible via GUI clients like mascon or
myadmin etc. Some of my MySQL databases got accessible by them and some
just telnet? depending on different provides?

Merci a bunch!


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




RE: Can't access MySQL via PHP

2001-11-03 Thread Peter Lovatt

Hi

should be

mysql_connect(fred.com, fredsusername, fredspassword)

or

mysql_connect($host, $username, $password)

Only needs quotes if you are using actual values

HTH

Peter

 -Original Message-
 From: Imran Aziz [mailto:[EMAIL PROTECTED]]
 Sent: 03 November 2000 19:49
 To: [EMAIL PROTECTED]
 Subject: Can't access MySQL via PHP


 Hi all,

 I have a MySQL database 'mydb' and I can perfectly access it via telnet. I
 have one database and I have full access to it. I can't create user and
 other databases, but its fine.

 Problem is that I write a PHP script and I can't access my sql database
 using that script! I got 'Access Denied' Error.

 I've tried MySQL grant commands e.g.

 Grant ALL PRIVILEGES
 ON mydb.*
 TO imran@%; (replaced % with my hostname etc. too)

 command is executed properly.


 Here is the PHP script:

   include(passwords.php);
   $openConn2db = mysql_connect( $hostname:$port,
 $username,$password );
   $dbSelected = mysql_select_db( $dbname, $openConn2db );
   $result = mysql_db_query ($dbname,select * from Girls);
   while ($row = mysql_fetch_array ($result))
   {
   $sFace = $row[face];
   print(trtdfont face='Arial'
 size='1'$sFace/font/td/tr);
   }


 How can I configure mysql so I can access it with my web applications too,
 not just telnet?

 And anyone knows how to make mysql accessible via GUI clients
 like mascon or
 myadmin etc. Some of my MySQL databases got accessible by
 them and some
 just telnet? depending on different provides?

 Merci a bunch!


 -
 Before posting, please check:
http://www.mysql.com/manual.php   (the manual)
http://lists.mysql.com/   (the list archive)

 To request this thread, e-mail [EMAIL PROTECTED]
 To unsubscribe, e-mail
 [EMAIL PROTECTED]
 Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php