Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8238975
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T19:59:14+00:00 2026-06-07T19:59:14+00:00

having some trouble creating a trigger across databases. I am doing this query through

  • 0

having some trouble creating a trigger across databases.

I am doing this query through phpmyadmin.

If I put the following through, I get an error saying no database selected.

delimiter // 
DROP trigger if exists t1// 
CREATE trigger t1 AFTER INSERT ON db1.d1t
FOR EACH ROW BEGIN

INSERT INTO db2.d2t SET ID=NEW.ID;

END// 
delimiter ;

If I navigate to db1 in Phpmyadmin and then do the following:

delimiter // 
DROP trigger if exists t1// 
CREATE trigger t1 AFTER INSERT ON db1t
FOR EACH ROW BEGIN

INSERT INTO db2.db2t SET ID=NEW.ID;

END// 
delimiter ;

There trigger is created but it is trying to insert on db1.db2.db2t When it fires.

Any help much appreciated.

EDIT:
Both Tables are INNODB
mysql server v. 5.1.61
phpmyadmin v. 3.4.5

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T19:59:15+00:00Added an answer on June 7, 2026 at 7:59 pm

    Try this (EDITED):

    USE db1;
    
    DROP TRIGGER IF EXISTS t1;
    
    DELIMITER //
    
    CREATE TRIGGER t1 AFTER INSERT ON d1t
    FOR EACH ROW BEGIN
      INSERT INTO db2.d2t
        (ID)
      VALUES
        (NEW.ID);
    END//
    
    DELIMITER ;
    

    This is working for me.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having some trouble figuring out the best/Djangoic way to do this. I'm creating
I'm having some trouble with this example of creating a transformer lambda with the
I am having some trouble creating a request to this WSDL that works; it
I'm having some trouble with this code: //Creating a new ImageElement Struct ImageElement oElement
I am having some trouble creating a nested association and I can't quite spot
I am having some trouble creating a seamless photo grid. I have searched the
I am having some serious trouble creating a WPF TreeView with an Object databinding.
I'm having some trouble with looping and creating MS Excel docs, code snippet below
I'm having some trouble creating an object in C++. I create a class called
I am having some trouble creating a for loop within a constructor to iterate

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.