Jump to content

Database Error


sanyisasha

Recommended Posts

Hi.

Why i get this error?

Quote

Access denied @ 'fileRename' [Database credentials protection denied resource <resource1> to access <resource2>]
Resource1: the resource what want to use fileRename
Resource2: the target resource where the rename happens

I want to make a class named Database, what in construct do dbConnect.
The resource1 is copy this class, but first rename meta.xml to meta.old.xml, and that's where the problem happens.
I tryed exporting the dbConnect value, same error.
I found out the dbConnect and it's value throw this error. But why i can't rename?

Thanks for help,
SaSha

Link to comment

So you want to take the connection to other resource as understand why not do this and add expprt in meta and done 

function connectionToMySQL() 
  connection = dbConnect() 
end
addEventHandler("onResourceStart", resourceRoot, connectionToMySQL) 


function getConnection
  return connection 
end 

 

Link to comment
9 minutes ago, MIKI785 said:

You're saying that youre not able to rename a file and you get an error saying 'Access denied', isnt that an ACL issue? Does the resource have access to it?

Its only happens when trying to rename resource's meta with database class in it. Read the full error message, not common access denied

Link to comment
  • Discord Moderators
Quote

Warning: As of 1.5.4 r10413, this function will fail when trying to access a script file of another resource, even with general.ModifyOtherObjects rights granted, which uses a mysql connection through dbConnect when database_credentials_protection is enabled in the server configuration. Additionally, meta.xml will be un-writable and will always open in read-only mode.

Copied from fileOpen's wiki page.

Edited by Pirulax
  • Thanks 1
Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...