Some time you face this problem specially new programmers while connecting to the mysql database that they are not able to connect it to the database on their hosting server whereas their username and password they have created are correct. So what the thing they missed out?
Its the hosting service prefix
whenever you are in any hosting serivice its having a username prefix for example
user login for hosting service bibo123 and password *******
so whenevr you create a database and new user to that hosting account it will prefic the bibo123_ on that database name and username too. So if you are having a database name student it will prefix the bibo123_ to it and it will become bibo123_student. so as it will do with the username also. for description their is an example below to connect to mysql database
hosting login: bibo123_
username you created: jinah
password: pikachu
Its the hosting service prefix
whenever you are in any hosting serivice its having a username prefix for example
user login for hosting service bibo123 and password *******
so whenevr you create a database and new user to that hosting account it will prefic the bibo123_ on that database name and username too. So if you are having a database name student it will prefix the bibo123_ to it and it will become bibo123_student. so as it will do with the username also. for description their is an example below to connect to mysql database
hosting login: bibo123_
username you created: jinah
password: pikachu
$username = bibo123_jinah;
$password = bibo123_password
mysql_connect("localhost", $username, $password) or die(mysql_error());
echo "Connected to MySQL
";
try it.
posted by honeyonsys
No comments:
Post a Comment