You didn't specify which distribution, so this is for Debian-based:
If you import everything, including the 'mysql' database and restart MySQL, you will have imported (and overwritten!) users from your old DB as well, as you stated. There are several things to keep in mind:
- Test it.
- Use long options when posting here.
--events
and --routines
is clearer that -R and -E (the latter you missed).
- if you have a
~/.my.cnf
or any other config file which specifies the (root) password, change it.
/etc/mysql/debian/cnf
contains the user account that the debian package manager uses to maintain your database server. That password will no longer work, so you will have to copy the password from that file on your old server. If your old server was not Debian-based and there is no debian-sys-maint
account, you may need to create one with SUPER
privileges.
I don't know what VestaCP does. You may want to dump its DB first and re-import it after your transfer.
mysql
database (the one containing meta data)? What are your dump commands? And what is your intention? You're moving your databases to another server?