How to full copy mysql table to different host/database with data and all keys?
Answered
I do right click on the source table in the list of database tables. Then select "Copy table to..." in context menu.
In popup window i choose the target database, then press <OK>
In result I see table and data, but no keys and indexes in target database.
How to full copy mysql table to different host/database with data and all keys?
Please sign in to leave a comment.
If you're trying to backup and restore a database from one host to another, you may have better luck using mysqldump. You can learn more about this here:
Backup: https://www.jetbrains.com/help/datagrip/export-data.html#create-a-full-data-dump-for-mysql-and-postgresql
Restore: https://www.jetbrains.com/help/datagrip/import-data.html#restore-a-full-dump-for-mysql-and-postgresql
Why we can not copy tables with indexes?
@... will this ever be fixed? It not only drops the indexes, primary keys but also changes the column types...
Up vote for the issue https://youtrack.jetbrains.com/issue/DBE-4516
But for backup / restore it's better to use native tools as mentioned earlier
Same problem. I dont need backup. I need just copy tables, indexes and data from production to local server.
In HeidiSQL its fast and simple task...
If you create two data sources for prod and local server you can select desired tables copy them via F5
Yes, but as mentioned before this does not copy indexes, primary keys etc.
So, then it could be done in a bit different way:
Do you guys have a plan to fix the bug?
This feature need be fixed because it doesn’t match user expectations.
https://youtrack.jetbrains.com/issue/DBE-4516/Copy-Table-Support-copying-constraints-and-indexes-too