简体   繁体   中英

Transfer specific table data between Schemas with different passwords on Mysql

I would like to select some data from a table in a schema and transfer from "SchemaExample1" to "SchemaExample2". These schemas have the same tables structures but they have different passwords.

For this, is the best approach to use this one? How can I transfer data between 2 MySQL databases?

I also tried to use:

alter table SchemaExample1.testTable rename SchemaExample2.testTable2

but this one gives me the error:

INSERT,CREATE command denied to user 'SchemaExample1'@'localhost' for table 'test_testTable2'

Side notes: I need to select part of the table on SchemaExample1.testTable and not the whole table.

I have two schemas, each one with their unique password:

  • "SchemaExample1 and
  • SchemaExample2;

to use these schemas I usually do like this: - mysql -u SchemaExample1 --password=test1; - mysql -u SchemaExample2 --password=test2;

如果希望按原样复制整个表,则可以mysqldump一个表并将其通过管道传递到mysql -u SchemaExample2 --password=test2 Schema2

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM