I have created an user in phpmyadmin in hosting server & when I upload & trying to open that page I am getting this warning.
Warning: mysql_connect() [function.mysql-connect]: Host ‘xxxxxxxxxx.com’ is not allowed to connect to this MySQL server in /home/xxxxxx/xxxxxx/config.php on line 7
It is working in my local system bt nt working in hosting server. If anyone have any idea kindly help me to short out this issue.
I have tried this also i got this error:
Warning: mysql_connect() [function.mysql-connect]: Access denied for user ‘xxxxx’@‘localhost’ (using password: YES) in /home/xxxxxxxx/xxxxxx/config.php on line 7
If i remove the password, i got
Warning: mysql_connect() [function.mysql-connect]: Access denied for user ‘xxxxx’@‘localhost’ (using password: NO) in /home/xxxxxxxx/xxxxxx/config.php on line 7
Its not in my local system, its a hosting server so here i think i have to give host name as server.
I belive you only need to give the host name if connecting to another server. I only ever use localhost on the servers I use.
Have you changed the passwords in your connection code to the same as the user you setup? On some setups the username will be prefixed with the usrename of the server along with the database names.
So if your password was world and your server login was hello then your password would be hello_world.
Have you tried asking your hosting provider? Or checked their online documentation/wiki? I know for the host I use, I have to setup the mysql domain name, then grant a mysql user access on that domain.
That is a step in the right direction. As now it seems you have a syntax error in your PHP file on line 8. Check that your string has the correct opening and closing quotes, a semi-colon, etc.
grant all privileges on $mysql_database.* to $mysql_user@‘%’ identified by $mysql_password;
flush privileges;
$bd = mysql_connect($mysql_hostname, $mysql_user, $mysql_password) or die(“There is some thing wrong in database connection”);
mysql_select_db($mysql_database, $bd) or die(“Some thing went wrong”);