CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • WordPress Installations (Moderators: Kurund Jalmi, Coleman Watts) »
  • DB Error: insufficient permissions
Pages: [1]

Author Topic: DB Error: insufficient permissions  (Read 914 times)

brod17

  • I’m new here
  • *
  • Posts: 4
  • Karma: 0
  • CiviCRM version: 4.4.6
  • CMS version: Wordpress
  • MySQL version: 14.4
  • PHP version: 5.3.3
DB Error: insufficient permissions
October 07, 2014, 05:28:06 am
Hi,

I have ran into a strange problem after moving my CIVI installation to new test domain. All CIVI functions are working correctly except adding/modifying a contact which gives the above error. Looking at the debug it is still using the old database user from the original location, and not the new database user.
My entry in CIVI settings file is mysql://wordpress_2b:<password>@localhost/wordpress_2B?new_link=true where wordpress_2b is the SQL user and wordpress_2B is the new database.

I have confirmed this file is being used by CIVI in that changing the password to an incorrect one causes CIVI to fail.

As a test I did a fresh install of CIVI to wordpress_2B and was able to create/modify users using the SQL user wordpress_2b, however after importing the live database the error reappeared.

I have done a full search through phpmyadmin of the imported database and can find no reference to the wordpress_1 SQL user that it is still trying to use.

Have followed the wiki instructions for moving CIVI and reset the backend settings/cleared caches etc.

Any help much appreciated.

Rod

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: DB Error: insufficient permissions
October 07, 2014, 06:31:14 am

1. not seeing the error with wordpress_1 in it

2. does your db user have trigger / stored procedure permissions?

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

brod17

  • I’m new here
  • *
  • Posts: 4
  • Karma: 0
  • CiviCRM version: 4.4.6
  • CMS version: Wordpress
  • MySQL version: 14.4
  • PHP version: 5.3.3
Re: DB Error: insufficient permissions
October 07, 2014, 07:07:31 am
Hi,

Thanks for getting back to me.
The user wordpress_1  definately has trigger permissions as everything works correctly when I use a fresh CIVI install and a blank database still using the same wordpress_2b SQL user and wordpress_2B database.
I only get the error when I import my live database into wordpress_2B, with no other changes.

The exact debug error I see is:

Database Error Code: TRIGGER command denied to user 'wordpress_1'@'%' for table 'civicrm_contact', 1142
Additional Details:

Array
(
    [callback] => Array
        (
           
  • => CRM_Core_Error
  • [1] => handle
            )

       
Code: [Select]
=> -26
    [message] => DB Error: insufficient permissions
    [mode] => 16
    [debug_info] => INSERT INTO civicrm_contact (contact_type , contact_sub_type , do_not_email , do_not_phone , do_not_mail , do_not_sms , do_not_trade , is_opt_out , external_identifier , sort_name , display_name , nick_name , preferred_communication_method , preferred_language , preferred_mail_format , hash , source , first_name , middle_name , last_name , prefix_id , suffix_id , email_greeting_id , email_greeting_custom , postal_greeting_id , postal_greeting_custom , addressee_id , addressee_custom , job_title , gender_id , birth_date , is_deceased ) VALUES ('Individual' ,  NULL ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  NULL , 'tes, test' , 'test tes' ,  NULL , '' , 'en_GB' , 'Both' , 'ee16ea145ff8417ea77c4693d00ef9e8' ,  NULL , 'test' ,  NULL , 'tes' ,  NULL ,  NULL ,  1 ,  NULL ,  1 ,  NULL ,  1 ,  NULL ,  NULL ,  NULL ,  NULL ,  0 )  [nativecode=1142 ** TRIGGER command denied to user 'wordpress_1'@'%' for table 'civicrm_contact']
    [type] => DB_Error
    [user_info] => INSERT INTO civicrm_contact (contact_type , contact_sub_type , do_not_email , do_not_phone , do_not_mail , do_not_sms , do_not_trade , is_opt_out , external_identifier , sort_name , display_name , nick_name , preferred_communication_method , preferred_language , preferred_mail_format , hash , source , first_name , middle_name , last_name , prefix_id , suffix_id , email_greeting_id , email_greeting_custom , postal_greeting_id , postal_greeting_custom , addressee_id , addressee_custom , job_title , gender_id , birth_date , is_deceased ) VALUES ('Individual' ,  NULL ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  NULL , 'tes, test' , 'test tes' ,  NULL , '' , 'en_GB' , 'Both' , 'ee16ea145ff8417ea77c4693d00ef9e8' ,  NULL , 'test' ,  NULL , 'tes' ,  NULL ,  NULL ,  1 ,  NULL ,  1 ,  NULL ,  1 ,  NULL ,  NULL ,  NULL ,  NULL ,  0 )  [nativecode=1142 ** TRIGGER command denied to user 'wordpress_1'@'%' for table 'civicrm_contact']
    [to_string] => [db_error: message="DB Error: insufficient permissions" code=-26 mode=callback callback=CRM_Core_Error::handle prefix="" info="INSERT INTO civicrm_contact (contact_type , contact_sub_type , do_not_email , do_not_phone , do_not_mail , do_not_sms , do_not_trade , is_opt_out , external_identifier , sort_name , display_name , nick_name , preferred_communication_method , preferred_language , preferred_mail_format , hash , source , first_name , middle_name , last_name , prefix_id , suffix_id , email_greeting_id , email_greeting_custom , postal_greeting_id , postal_greeting_custom , addressee_id , addressee_custom , job_title , gender_id , birth_date , is_deceased ) VALUES ('Individual' ,  NULL ,  0 ,  0 ,  0 ,  0 ,  0 ,  0 ,  NULL , 'tes, test' , 'test tes' ,  NULL , '' , 'en_GB' , 'Both' , 'ee16ea145ff8417ea77c4693d00ef9e8' ,  NULL , 'test' ,  NULL , 'tes' ,  NULL ,  NULL ,  1 ,  NULL ,  1 ,  NULL ,  1 ,  NULL ,  NULL ,  NULL ,  NULL ,  0 )  [nativecode=1142 ** TRIGGER command denied to user 'wordpress_1'@'%' for table 'civicrm_contact']"]
)

As you can see it is still using wordpress_1 as the SQL user not wordpress_2b.

Regards,

Rod

ps: Is a test system so I can email login username/password if needed.


Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: DB Error: insufficient permissions
October 07, 2014, 08:11:24 am

1. might be easier to use the same DB user/pass on all machines

2. alternatively, you can take a backup without the triggers and get civi to rebuild the triggers from the admin menu

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

brod17

  • I’m new here
  • *
  • Posts: 4
  • Karma: 0
  • CiviCRM version: 4.4.6
  • CMS version: Wordpress
  • MySQL version: 14.4
  • PHP version: 5.3.3
Re: DB Error: insufficient permissions
October 07, 2014, 08:40:07 am
Cheers Donald, your tip to backup the database skipping the triggers solved the problem.

Thanks once again for your help.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • WordPress Installations (Moderators: Kurund Jalmi, Coleman Watts) »
  • DB Error: insufficient permissions

This forum was archived on 2017-11-26.