Cannot connect to MySQL using
Cannot connect to MySQL using
am 30.03.2006 00:31:20 von Nur_Adman
------_=_NextPart_001_01C65380.8120226D
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Dear All,
=20
=20
I need some help. I`m trying to connect to MySQL using these script :
=20
=20
$dbHostname =3D "localhost";
$dbUsername =3D "root";
$dbPassword =3D "";
$dbName =3D "cms"; =20
=20
// Make connection to database=20
// If no connection made, display error Message =20
$dblink =3D mysql_connect($dbHostname, $dbUsername, $dbPassword) =
or
die("Error !! Unable to connect to database"); =20
=20
// Select database or print error message if unsuccessful */
mysql_select_db($dbName) or die( "Unable to select database
".$dbName);=20
=20
?>
=20
But if I changed the Hostname with the Server Name/IP Address (not using
localhost), the error message become :
=20
Warning: mysql_connect() [function.mysql-connect
]: Host
'157.47.115.180' is not allowed to connect to this MySQL server in
c:\wamp\www\CMS\forecast\includes\db_connection.php on line 10
Error !! Unable to connect to database
=20
=20
What should I do?
=20
Thanks & Regards,
=20
Anita
=20
------_=_NextPart_001_01C65380.8120226D--
RE: Cannot connect to MySQL using
am 30.03.2006 00:39:29 von Ralph Brickley
It looks right on the function use, but you may want to check the
installation of the mySQL service to ensure you have the right setup. There
is normally always a password on root.
Also, I would be a little more careful of pasting your IP Address into a
message forum. I'm sure we are all honest people but you never know. Coupled
with your DB name we can now look at your data if we get in.
You didn't tell us what the error was when using 'localhost' versus the IP
address. What does it say then?
-----Original Message-----
From: Nur_Adman@fmi.com [mailto:Nur_Adman@fmi.com]
Sent: Wednesday, March 29, 2006 2:31 PM
To: php-db@lists.php.net
Subject: [PHP-DB] Cannot connect to MySQL using
Dear All,
I need some help. I`m trying to connect to MySQL using these script :
$dbHostname = "localhost";
$dbUsername = "root";
$dbPassword = "";
$dbName = "cms";
// Make connection to database
// If no connection made, display error Message
$dblink = mysql_connect($dbHostname, $dbUsername, $dbPassword) or
die("Error !! Unable to connect to database");
// Select database or print error message if unsuccessful */
mysql_select_db($dbName) or die( "Unable to select database
".$dbName);
?>
But if I changed the Hostname with the Server Name/IP Address (not using
localhost), the error message become :
Warning: mysql_connect() [function.mysql-connect
]: Host
'157.47.115.180' is not allowed to connect to this MySQL server in
c:\wamp\www\CMS\forecast\includes\db_connection.php on line 10
Error !! Unable to connect to database
What should I do?
Thanks & Regards,
Anita
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Cannot connect to MySQL using
am 30.03.2006 00:43:12 von Chris
> Warning: mysql_connect() [function.mysql-connect
> ]: Host
> '157.47.115.180' is not allowed to connect to this MySQL server in
> c:\wamp\www\CMS\forecast\includes\db_connection.php on line 10
> Error !! Unable to connect to database
>
>
>
>
>
> What should I do?
Read the error message, it tells you all you need to know.
Your host (157.47.115.180) is not allowed to connect to that mysql server.
Mysql isn't configured to allow connections using the ip.
http://dev.mysql.com/doc/refman/5.1/en/privilege-system.html
Is a good place to start.
--
Postgresql & php tutorials
http://www.designmagick.com/
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
RE: Cannot connect to MySQL using
am 30.03.2006 00:51:41 von Nur_Adman
------_=_NextPart_001_01C65383.58D7A4B5
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
If I used "localhost", the script running well.
But if I used Server name or IP address, the error message displayed :
=20
Warning: mysql_connect() [function.mysql-connect
]: Host
'157.47.115.180' is not allowed to connect to this MySQL server in
c:\wamp\www\CMS\forecast\includes\db_connection.php on line 10
Error !! Unable to connect to database
=20
=20
Thanks & Regards,
Anita
=20
=20
=20
-----Original Message-----
From: Ralph Brickley [mailto:ralphbrickley@verizon.net]=20
Sent: Thursday, March 30, 2006 7:39 AM
To: Adman, Nur anita; php-db@lists.php.net
Subject: RE: [PHP-DB] Cannot connect to MySQL using
=20
It looks right on the function use, but you may want to check the
installation of the mySQL service to ensure you have the right setup.
There
is normally always a password on root.
=20
Also, I would be a little more careful of pasting your IP Address into a
message forum. I'm sure we are all honest people but you never know.
Coupled
with your DB name we can now look at your data if we get in.
=20
You didn't tell us what the error was when using 'localhost' versus the
IP
address. What does it say then?
=20
-----Original Message-----
From: Nur_Adman@fmi.com [mailto:Nur_Adman@fmi.com]=20
Sent: Wednesday, March 29, 2006 2:31 PM
To: php-db@lists.php.net
Subject: [PHP-DB] Cannot connect to MySQL using
=20
Dear All,
=20
=20
=20
=20
=20
I need some help. I`m trying to connect to MySQL using these script :
=20
=20
=20
=20
=20
=20
$dbHostname =3D "localhost";
=20
$dbUsername =3D "root";
=20
$dbPassword =3D "";
=20
$dbName =3D "cms"; =20
=20
=20
=20
// Make connection to database=20
=20
// If no connection made, display error Message =20
=20
$dblink =3D mysql_connect($dbHostname, $dbUsername, $dbPassword) =
or
die("Error !! Unable to connect to database"); =20
=20
=20
=20
// Select database or print error message if unsuccessful */
=20
mysql_select_db($dbName) or die( "Unable to select database
".$dbName);=20
=20
=20
=20
?>
=20
=20
=20
But if I changed the Hostname with the Server Name/IP Address (not using
localhost), the error message become :
=20
=20
=20
Warning: mysql_connect() [function.mysql-connect
]: Host
'157.47.115.180' is not allowed to connect to this MySQL server in
c:\wamp\www\CMS\forecast\includes\db_connection.php on line 10
Error !! Unable to connect to database
=20
=20
=20
=20
=20
What should I do?
=20
=20
=20
Thanks & Regards,
=20
=20
=20
Anita
=20
=20
=20
=20
------_=_NextPart_001_01C65383.58D7A4B5--
Re: Cannot connect to MySQL using
am 30.03.2006 01:21:04 von Balazs Hegedus
Hi,
did you try to grant the IP address?
I mean:
grant x,y,z on db_name.{table_name|*} to user_name@server_ip_address
identified by 'password';
Hope it helps, cheers,
Balazs
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
RE: Cannot connect to MySQL using
am 30.03.2006 02:05:24 von Nur_Adman
------_=_NextPart_001_01C6538D.A547C68D
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Dear All,
=20
I found the way.
=20
I opened file --> C:\WINNT\system32\drivers\etc\hosts
Then change :
127.0.0.1 localhost
become :
157.47.115.180 [my_server_name]
=20
Then my problem solved.
=20
=20
Thanks & Regards,
Anita
------_=_NextPart_001_01C6538D.A547C68D--
Re: Cannot connect to MySQL using
am 30.03.2006 10:44:06 von Constantin Wolber
Nur_Adman@fmi.com wrote:
>Then change :
>
> 127.0.0.1 localhost
>
>become :
>
>157.47.115.180 [my_server_name]
>
>
Changing this line is probably not the best way. This file is used for
resolving the hostnames ti ip adresses. So a better way would probably
be adding the line to the file. Since the entry for localhost should
remain in this file.
Greets Constantin
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
RE: Cannot connect to MySQL using
am 30.03.2006 22:56:52 von Nur_Adman
------_=_NextPart_001_01C6543C.78E4344D
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Thanks so much, Constantin...
=20
Regards,
Anita
=20
-----Original Message-----
From: Constantin Wolber [mailto:cwolbe@gmx.de]=20
Sent: Thursday, March 30, 2006 5:44 PM
To: php-db@lists.php.net
Subject: Re: [PHP-DB] Cannot connect to MySQL using
=20
Nur_Adman@fmi.com wrote:
=20
>Then change :
>=20
> 127.0.0.1 localhost
>=20
>become :
>=20
>157.47.115.180 [my_server_name]
> =20
>=20
=20
Changing this line is probably not the best way. This file is used for
resolving the hostnames ti ip adresses. So a better way would probably
be adding the line to the file. Since the entry for localhost should
remain in this file.
=20
Greets Constantin
=20
--=20
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
=20
------_=_NextPart_001_01C6543C.78E4344D--