Jump to content

Database problem


JcX

Recommended Posts

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

Link to comment
Share on other sites

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...

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 djbob
The first option.
Link to comment
Share on other sites

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...