Mysql – How toNSERT row in another database/schema in MySQL

insertMySQLschema

Let's say I have the following database/schema setup with the following tables:

    SCHEMA_1 (default):
        TABLE_1

    SCHEMA_2:
        TABLE_2

How do I insert rows in another schema's table? The following does not seem to work:

    INSERT INTO TABLE_2 (...) VALUES(...)

How is it possible to insert rows in another another schema?

Best Answer

Fully qualify the table name:

insert into SCHEMA_2.TABLE_2 values( ... );