alienmojo Posted February 15, 2007 Share Posted February 15, 2007 im trying to connect to a database and i am getting this Access denied for user ''@'localhost' to database 'realestate' Quote Link to comment https://forums.phpfreaks.com/topic/38650-database/ Share on other sites More sharing options...
steviez Posted February 15, 2007 Share Posted February 15, 2007 have you entered all the information in the settings correctly? username, password, server etc Quote Link to comment https://forums.phpfreaks.com/topic/38650-database/#findComment-185546 Share on other sites More sharing options...
mbtaylor Posted February 15, 2007 Share Posted February 15, 2007 is your database username really 'user'? Check your connection details Quote Link to comment https://forums.phpfreaks.com/topic/38650-database/#findComment-185552 Share on other sites More sharing options...
Balmung-San Posted February 15, 2007 Share Posted February 15, 2007 The error looks to me like you're trying to connect with no username, or that the username you're using does not have permissions to access that database. Quote Link to comment https://forums.phpfreaks.com/topic/38650-database/#findComment-185555 Share on other sites More sharing options...
Iron Bridge Posted February 15, 2007 Share Posted February 15, 2007 Try using something like this: $DBhost = "myserver.com"; // Replace myServer.com with the url (without http://) for your Database Server $DBuser = "myLogin"; // Replace myLogin with your login $DBpass = "myPassword"; // Replace myPassword with your password $DBName = "myDataBaseName"; // Replace myDatabaseName with your DB name $table = "myTableName"; // I think you get the idea // Connect to mySQL Server $DBConn = mysql_connect($DBhost,$DBuser,$DBpass) or die("Error1 in Guest List Application: " . mysql_error()); // Select mySQL Database mysql_select_db($DBName, $DBConn) or die("Error2 in Guest List Application: " . mysql_error()); Quote Link to comment https://forums.phpfreaks.com/topic/38650-database/#findComment-185565 Share on other sites More sharing options...
alienmojo Posted February 15, 2007 Author Share Posted February 15, 2007 well im thinking that i dont have permission to do access the database because my connect is working (im not connecting as user and im not sure why its saying that) but anyway i have if statement testing the connection on the mysql-connect and mysql_select_db it its having a problem with the mysql_select_db Quote Link to comment https://forums.phpfreaks.com/topic/38650-database/#findComment-185618 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.