• I recently changed domains of my wordpress site. I exported the database and imported it into a new database, then updated wp-config to point to my new database and username. For simplicities sake let’s say the old database was olddatabasename and the old user was olduser. The new database is newdatabasename and the new user is newuser.

    My wp-config file now reads:
    /** The name of the database for WordPress */
    define(‘DB_NAME’, ‘newdatabasename’);

    /** MySQL database username */
    define(‘DB_USER’, ‘newuser’);

    However, when updating a post the post does not actually get updated. When I turn debug mode on I get the following error:

    WordPress database error: [TRIGGER command denied to user ‘olduser’@’localhost’ for table ‘wp_postmeta’]

Viewing 4 replies - 1 through 4 (of 4 total)
  • might be you hard coded that olduser somewhere.

    Thread Starter Vcize

    (@vcize)

    I searched the WP files and there’s nothing hardcoded other than wp-config.

    However I did find this in my database import script:

    /*!50003 CREATE*/ /*!50017 DEFINER=olduser@localhost*/ /*!50003 TRIGGER wp_postmeta_after_insert AFTER INSERT ON wp_postmeta

    Do I just need to run that same statement (and the other similar ones) in phpmyadmin but replaced with ‘newuser’? Is there anything I need to do to delete that trigger created for olduser? Is there something I should have done differently when moving things over to avoid having this statement in my import file?

    Thread Starter Vcize

    (@vcize)

    So it looks like it was the triggers. I dropped them and recreated them with the new username and that appears to have fixed it.

    I see. Glad to hear.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘WordPress looking at old DB username?’ is closed to new replies.