JcX Posted April 13, 2008 Posted April 13, 2008 Hi, anyone who sees this. I'm having a problem with database. When I execute mysql_select_db function in my php script, I get this error Warning: mysql_select_db() [function.mysql-select-db]: Access denied for user 'jcx'@'localhost' (using password: NO) in /home/jcx/public_html/myillion/upload.php on line 31 Warning: mysql_select_db() [function.mysql-select-db]: A link to the server could not be established in /home/jcx/public_html/myillion/upload.php on line 31 The main point is Access denied for user "jcx@localhost". Because when I enter cPanel -> MySQL Database, whatever actions I did on database(rename, copy, etc), I get the same error Access denied for jcx@localhost. And the second line error, link to server could not be established. Does that means MySQL database is not functioning? Can anyone tell me what's wrong? Weeks before, I also do the same thing on phpmyadmin, but I'm not restricted for such things. The same php scripts also can function on databases, but now I received this 2 lines error. Can anyone help me? Million thanks come first! JcX
Ashoat Posted April 13, 2008 Posted April 13, 2008 The error message says you are not using a password. Could that be the problem? Are you trying to access from cPanel, or PHPMyAdmin? Access will be denied from PHPMyAdmin, and I can't find those functions on cPanel...
ShannenName Posted April 13, 2008 Posted April 13, 2008 He said When I execute mysql_select_db function in my php script so I'm guessing the error is coming from the script not cPanel or PHPMyAdmin
Ashoat Posted April 14, 2008 Posted April 14, 2008 Because when I enter cPanel -> MySQL Database, whatever actions I did on database(rename, copy, etc), I get the same error Access denied for jcx@localhost.
JcX Posted April 14, 2008 Author Posted April 14, 2008 Dear Shannen : I've tried exactly the same script on my localhost before trying on Heliohost. Script successfully execute in localhost, can INSERT INTO database and mysql_fetch_array function also can select and retrieve data from database table. Dear djbob : I access from PhpMyAdmin, but in my memories, I remember I can modify my database before without receiving these errors. I only encountered these errors recently, after I changed my master password. Could this connected to the source of problem?? In PhpMyAdmin, I always receive this error when doing something on my database or table. #1044 - Access denied for user 'jcx'@'localhost' to database 'test' While in MySQL database menu found in cPanel, I've added a user with password and give all privileges to access the database. The error message I receive (using password: NO), suggests that I'm not using any password?? Anyway, I've tried not using password to mysql_connect, the error message is even more. And one more question for djbob, if I've created a user "jcx_jcx", with password "abcdef" and a database "jcx_test", when I use mysql_connect function, should I enter as follows? mysql_connect ("localhost", "abcdef", "jcx_jcx") mysql_select_db ("jcx_test") or as follow mysql_connect ("localhost", "abcdef", "jcx") mysql_select_db ("test") I'm still confused with this since my user and database names created for MySQL database is an extension of my master account. Hopefully my info can help you all to solve my problems. Thanks. JcX
Ashoat Posted April 14, 2008 Posted April 14, 2008 While in MySQL database menu found in cPanel, I've added a user with password and give all privileges to access the database. The error message I receive (using password: NO), suggests that I'm not using any password?? Anyway, I've tried not using password to mysql_connect, the error message is even more.Hmmm... try changing your password again. Make sure to wait through the whole process again. And one more question for djbobThe first option.
JcX Posted April 15, 2008 Author Posted April 15, 2008 Dear all, I figured out what's the problem of the database already. Please don't laugh at me. I've mislocated the mysql_connect() in my php script. I put this function at bottom of my script, that's why I couldn't connect to database at first. Very sorry to bother you all. And about the PhpMyAdmin, I still encounter the error message when performing some actions on databases. #1044 - Access denied for user 'jcx'@'localhost' to database 'test' And for the question, I successfully connect mysql by using jcx, not jcx_jcx.... Anyway, best regards for all, cheers! JcX
Ashoat Posted April 18, 2008 Posted April 18, 2008 As I said earlier, PHPMyAdmin is not permitted to do root-level processes; this is by design.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now