Import a local SQL File To MySQL on a Remote Server Using SSH Tunnel
You should run this command
mysql -h host -u user_name -pPassword database < file.sql > output.log
file.sql contains the sql queries to run and output.log makes sense only when you have a query that returns something (like a select)
The only thing different I can see in your code is the blank space between the -p option and the password. If you use the -p option, you must write the password without leaving any blank space. Or you just can user the option --password=Password
I hope you can solve the problem
1. mysql -h xxx -uxxx -pxxx . //login to the remote mysql 2. use DATABASE. //assign which db to import 3. source path/to/file.sql //the path can be your local sql file path.
Reference: Import SQL file into mysql