Jump to content

Recommended Posts

Posted

I was trying to get a MySQL user-defined function working but was getting an error that I don't have permission to access/write to the table 'mysql'.

 

CREATE FUNCTION myfunc_double RETURNS REAL SONAME "udf_example.so"

 

Access denied for user 'MYUSERACCOUNT'@'localhost' to database 'mysql'

 

I believe 'mysql' is responsible for maintaining a list of available functions, and that might cause conflicts on a shared server, but I still need the functionality. I have data that really needs a custom function to prune it at the database level.

 

Thanks for any help/info!

Posted
Welcome to the forums ksturner

 

Did you add a user to the database with read/write access?

 

Yes, but I don't believe it matters because the database in question is 'mysql', not the database containing my personal data. This is a snip from a comment in the MySQL example file for a UDF:

 

/*

** example file of UDF (user definable functions) that are dynamicly loaded

** into the standard mysqld core.

**

** The functions name, type and shared library is saved in the new system

** table 'func'. To be able to create new functions one must have write

** privilege for the database 'mysql'. If one starts MySQL with

** --skip-grant, then UDF initialization will also be skipped.

...

** The CREATE FUNCTION and DROP FUNCTION update the func@mysql table. All

** Active function will be reloaded on every restart of server

** (if --skip-grant-tables is not given)

...

 

I think this is what I'm encountering.

Join the conversation

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

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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...