Skip to main content
Inspiring
October 13, 2008
Question

Mysql Access Denied

  • October 13, 2008
  • 1 reply
  • 693 views
In a few simple pages, I add/change/delete and list data from a MYSQL table. It works fine 90 percent of the time. The other 10 percent I get an Access Denied SQL error. If I simply click my SEARCH button again to list the database, it always works. It is as if there is some sort of lock on data I have updated and it needs a second or two to release it. I have tried looping the SQL upon receiving an error, but this does not work. The page must return without displaying data, then click again, and then it is successful.

As I said, this only happens 10 percent of the time, and even less if I am not so quick going to this list immediately after making a table update. This happens on my local PC as well as well as when hosted on the web.

This sound familiar to anyone ?

KEN

Below is an example error page:
Error Executing Database Query.
Access denied for user 'root'@'localhost' (using password: NO)

The error occurred in C:\ColdFusion\wwwroot\SGBC\FC\icPsn.cfc: line 309
Called from C:\ColdFusion\wwwroot\SGBC\AM40\apPsnList.cfm: line 67
Called from using password: line -1
Called from using password: line -1

307 : </cfif>
308 : <cfif this.st_record.sg_fname IS NOT "">
309 : AND psn.FirstName LIKE '%#this.st_record.sg_fname#%'
310 : </cfif>
311 : ORDER BY psn.LastName ,


--------------------------------------------------------------------------------

SQLSTATE 28000
SQL SELECT psn.ID , psn.LastName , psn.FirstName , psn.Descr , psn.Filename , psn.UPDttm , psn.Up_Psn_ID , psn.EmailAddress , psn.PsnPswd , psn.Active , psn.Phone , psn.Ext , psn.ImageDir FROM person psn WHERE psn.Active = 1 ORDER BY psn.LastName , psn.FirstName
VENDORERRORCODE 1045
DATASOURCE dcw0101tst1

This topic has been closed for replies.

1 reply

Inspiring
February 25, 2009
Update:
I think this was caused by a CFTRANSACTION tag I had around the SQL. Apparently, at least on Windows servers, this caused contention on the folder or files in use by MySQL, and I assume Windows denied access, and thus the error. It seems CFTRANSACTION caused a lock of some sort which resolves within a second or two, but if you update a record and then try to access that same table immediately, the lock as not been released, at least some percentage of the time. Since taking out CFTRANSACTION, I haven't experienced this error.