jalaladdin Posted September 15, 2011 Share Posted September 15, 2011 i upload all fill in Cpanel and i create database call m_user and i create user name=m_mi,password=1234abcd but ie display this errorCould not connect: Access denied for user 'root'@'localhost' (using password: NO) Link to comment Share on other sites More sharing options...
birbal Posted September 15, 2011 Share Posted September 15, 2011 What code are you using to connect? Link to comment Share on other sites More sharing options...
jalaladdin Posted September 15, 2011 Author Share Posted September 15, 2011 What code are you using to connect? i'm using this code toconnect$con = mysql_connect("localhost","root","");if (!$con) { die('Could not connect: ' . mysql_error()); }mysql_select_db("m_a", $con); Link to comment Share on other sites More sharing options...
jalaladdin Posted September 15, 2011 Author Share Posted September 15, 2011 ie display this errorCould not connect: Access denied for user 'root'@'localhost' (using password: NO Link to comment Share on other sites More sharing options...
Ingolme Posted September 15, 2011 Share Posted September 15, 2011 Obviously, you have to use your current database user: mysql_connect("localhost","m_mi","1234abcd"); The server might not even be localhost. Look at your Cpanel to see what the name of the SQL server is. Link to comment Share on other sites More sharing options...
jalaladdin Posted September 15, 2011 Author Share Posted September 15, 2011 Obviously, you have to use your current database user:mysql_connect("localhost","m_mi","1234abcd"); The server might not even be localhost. Look at your Cpanel to see what the name of the SQL server is. i was delete user only i have database m_a Link to comment Share on other sites More sharing options...
jalaladdin Posted September 16, 2011 Author Share Posted September 16, 2011 please guide me Link to comment Share on other sites More sharing options...
Ingolme Posted September 16, 2011 Share Posted September 16, 2011 You need to use your webhost username and password in the mysql_connect() command. Also make sure that the SQL server is correct. Check your web host for details. mysql_connect('sql.mywebhost.com','myusername','mypassword'); Link to comment Share on other sites More sharing options...
jalaladdin Posted September 16, 2011 Author Share Posted September 16, 2011 i am sure my sql is correct Link to comment Share on other sites More sharing options...
Synook Posted September 16, 2011 Share Posted September 16, 2011 ... well, obviously it isn't, since you don't seem to be able to log in correctly. What does your code look like now? Link to comment Share on other sites More sharing options...
lauralee Posted October 4, 2011 Share Posted October 4, 2011 When you set up your website on a server you used a username and a password. Place them in your code where indicated below. $con = mysql_connect("localhost","username","password"); Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.