Jump to content

MySQL Problem


gravereaper

Recommended Posts

'Warning: mysql_connect() [function.mysql-connect]: Host 'MYHOST is not allowed to connect to this MySQL server in D:\xampplite\htdocs\test\hi.php on line 2Could not connect: Host 'MYHOST' is not allowed to connect to this MySQL server' When i try to execute the following code:

<?php$con = mysql_connect("rehan","Root"," ");if (!$con)  {  die('Could not connect: ' . mysql_error());  }// Create databaseif (mysql_query("CREATE DATABASE my_db",$con))  {  echo "Database created";  }else  {  echo "Error creating database: " . mysql_error();  }// Create table in my_db databasemysql_select_db("my_db", $con);$sql = "CREATE TABLE Person (FirstName varchar(15),LastName varchar(15),Age int)";mysql_query($sql,$con);mysql_close($con);?>

Need help to bypass this..

Link to comment
Share on other sites

You can't "bypass" it, it's a security setting in MySQL. You have to change the setting. MySQL can be setup to either allow remote connections or not, so it's probably set to deny remote connections. It might be able to accept connections from certain hosts, I haven't tried that.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...