I have a production MySQL server and I want to copy everything to a development MySQL server (actually, I believe it is really MariaDB on the development side). Both servers are hosted (one Azure, the other another hosting service).
One challenge is that the database names are different (and cannot be fixed).
I finally found something that seemed like a good solution in this answer, which is basically to use this command:
mysqldump --no-create-db old_db_name \
--single-transaction --compress \
--order-by-primary \
--host old_db_host \
-u old_db_user -pOld_db_password |
mysql --host new_host -u new_user -pnewpassword \
new_db_name
However, when I execute this, I get the following:
WARNING: --compress is deprecated and will be removed in a future version. Use --compression-algorithms instead. Warning: A partial dump from a server that has GTIDs will by default include the GTIDs of all transactions, even those that changed suppressed parts of the database. If you don't want to restore GTIDs, pass --set-gtid-purged=OFF. To make a complete dump, pass --all-databases --triggers --routines --events.
ERROR 1227 (42000) at line 18: Access denied; you need (at least one of) the SUPER, BINLOG ADMIN privilege(s) for this operation
mysqldump: Got errno 0 on write
I'm specifically concerned about the
Access denied; you need (at least one of) the SUPER, BINLOG ADMIN privilege(s) for this operation
I found this question which made me think the problem has to do with DEFINER (not sure what this is). However, when looking for answers, I found answers like the ones here. However, these seem to only work when dumping the data to a file and I'm trying to transfer directly to the other server.
Is there a way to fix this? Or perhaps I'm really going about this the wrong way.