I use the following query when I want to copy a MySQL database:
mysqldump --opt -h HOSTNAME -u USERNAME -p PASSWORD DATABASENAME| gzip > name.sql
But I get this error:
mysqldump: Got error: 1045: Access denied for user (using password: YES) when trying to connect server
When I was looking for a solution I found a lot of answers, but in every case the problem appears on localhost - I have this problem in my hosting...could anyone help?
Try to remove the space between -p
and PASSWORD
mysqldump --opt -h 127.0.0.1 -u root -proot DATABASENAME| gzip > name.sql
User: root Password: root
The password parameter must be concatenated to the parameter. Anyway, check your credentials too!
PS: name.sql
should be name.sql.zip
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With