Current location: Hot Scripts Forums » Programming Languages » PHP » Warning: mysql_query() [function.mysql-query]: Access denied for user 'mylogi'@'localhost' (using pa


Warning: mysql_query() [function.mysql-query]: Access denied for user 'mylogi'@'localhost' (using pa

Reply
  #1 (permalink)  
Old 05-26-08, 11:56 PM
tut123408 tut123408 is offline
New Member
 
Join Date: May 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Warning: mysql_query() [function.mysql-query]: Access denied for user 'mylogi'@'localhost' (using pa

I paid over 1,000 for this script and the programmer left me without support and I need your guy's help. He sent me the script in zip format and I installed everything but I found an error.

I installed the script to a test server you can view it below

Problem : I get an error when I click on all categories

Click the link below and click all categories and you should see this error.
http://www.cashchunk.com/User/new_se...=y&keywords=dd

Warning: mysql_query() [function.mysql-query]: Access denied for user 'tutran'@'localhost' (using password: NO) in /home/tutran/public_html/cashchunk/User/get_cat.php on line 30

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/tutran/public_html/cashchunk/User/get_cat.php on line 30

Warning: mysql_query() [function.mysql-query]: Access denied for user 'tutran'@'localhost' (using password: NO) in /home/tutran/public_html/cashchunk/User/get_cat.php on line 31

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/tutran/public_html/cashchunk/User/get_cat.php on line 31

Warning: mysql_query() [function.mysql-query]: Access denied for user 'tutran'@'localhost' (using password: NO) in /home/tutran/public_html/cashchunk/User/get_cat.php on line 32

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/tutran/public_html/cashchunk/User/get_cat.php on line 32

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/tutran/public_html/cashchunk/User/get_cat.php on line 36
All Categories (0)

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/tutran/public_html/cashchunk/User/get_cat.php on line 68

Please help!
Reply With Quote
  #2 (permalink)  
Old 05-27-08, 12:54 AM
mab's Avatar
mab mab is offline
Community VIP
 
Join Date: Oct 2005
Location: Denver, Co. USA
Posts: 2,674
Thanks: 0
Thanked 0 Times in 0 Posts
The error that is occurring for a mysql_query() statement means there is not an existing connection to a mysql server when the mysql_query() is executed. Under this condition, php attempts to create a connection using all default values and since that typically means no default password is set in php.ini (which is a security hole if it was) the connection fails with the error message you are getting.

Without seeing the code, I can tell you that this means that the code that is supposed to be making the connection to the mysql server is failing and that code is not doing any error checking, error reporting, or error recovery and is allowing all the following logic to blindly continue executing with no valid connection to a database server.

The final two error messages mean that there is also no error checking, error reporting, or error recovery logic on the mysql_query() statement, which when it fails, allows the following code to blindly attempt to reference a result resource that does not exist.

This type of coding is seen in php programming help forums all the time and is at about the level that would earn a C- in a programming class. Code at this quality level should certainly not be offered for sale.

If you post the relevant code here in the forum, someone can help you add some basic error checking logic that will pin down why it is not connecting to the mysql database. My guess would be either that a database/database user/password has not been created or the database connection information has not been entered into the script.
__________________
Error checking, error reporting, and error recovery. If your code does not have these to get it to tell you why it is not working, what makes you think someone in a programming forum will be able to tell you why it is not working???

Last edited by mab; 05-27-08 at 12:56 AM.
Reply With Quote
  #3 (permalink)  
Old 05-27-08, 01:01 AM
curbview.com's Avatar
curbview.com curbview.com is offline
Junior Code Guru
 
Join Date: May 2006
Posts: 555
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by tut123408 View Post
Warning: mysql_query() [function.mysql-query]: Access denied for user 'tutran'@'localhost' (using password: NO) in /home/tutran/public_html/cashchunk/User/get_cat.php on line 30


Please help!
1) Ask your hosting provider to supply you with the correct login info OR
2) Login through phpmyadmin and use that info.
3) Those login details are for your developer's database, not yours.
4) HTH :0
__________________
Whatever you decide, you should make sure best security methods are used and practiced. Should you really need more help, PM me.
Reply With Quote
  #4 (permalink)  
Old 05-27-08, 01:09 AM
mab's Avatar
mab mab is offline
Community VIP
 
Join Date: Oct 2005
Location: Denver, Co. USA
Posts: 2,674
Thanks: 0
Thanked 0 Times in 0 Posts
That would be correct if the error was referring to a mysql_connect() statement, but it is not.

From the mysql_query section of the php manual -

Quote:
The MySQL connection. If the link identifier is not specified, the last link opened by mysql_connect() is assumed. If no such link is found, it will try to create one as if mysql_connect() was called with no arguments. If by chance no connection is found or established, an E_WARNING level warning is generated.
__________________
Error checking, error reporting, and error recovery. If your code does not have these to get it to tell you why it is not working, what makes you think someone in a programming forum will be able to tell you why it is not working???
Reply With Quote
  #5 (permalink)  
Old 05-27-08, 01:19 AM
curbview.com's Avatar
curbview.com curbview.com is offline
Junior Code Guru
 
Join Date: May 2006
Posts: 555
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by mab View Post
That would be correct if the error was referring to a mysql_connect() statement, but it is not.

From the mysql_query section of the php manual -
Gee, the OP posted MySQL problems, not php so after seeing a line in his post (the one I quoted), I decided to post what I have seen and know from my MySQL experience.

VIEW: http://www.google.com/search?q=Acces...ient=firefox-a

You mentioned this at the bottom of you post now that I had a chance to read it entirely.
__________________
Whatever you decide, you should make sure best security methods are used and practiced. Should you really need more help, PM me.

Last edited by curbview.com; 05-27-08 at 01:28 AM.
Reply With Quote
  #6 (permalink)  
Old 05-27-08, 11:29 PM
tut123408 tut123408 is offline
New Member
 
Join Date: May 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Thank you very much for your help. I found out the problem has to do with the installation. The programmer had another file that I had to change the settings to.
Reply With Quote
  #7 (permalink)  
Old 05-27-08, 11:50 PM
curbview.com's Avatar
curbview.com curbview.com is offline
Junior Code Guru
 
Join Date: May 2006
Posts: 555
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by tut123408 View Post
Thank you very much for your help. I found out the problem has to do with the installation. The programmer had another file that I had to change the settings to.
So it was the login / connection settings as I stated in my previous post... Glad to help you along.
__________________
Whatever you decide, you should make sure best security methods are used and practiced. Should you really need more help, PM me.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump


All times are GMT -5. The time now is 07:44 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.