If importing a SQL dump file using the
mysql command line client, if it wasn't created by the superuser and guaranteed to not have been modified, for security it's best practice to not execute it as the root user.
I know this can be done using the
-p arguments, but is there a way to not have to know the password for the user if you already have the ability to log in as root (e.g. the root password is in /root/.my.cnf)? Like is there some way to log in as root then switch to the particular user, or some other easy way to accomplish this?