Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mysqldump: Got error: 1045: Access denied for user (using password: YES) when trying to connect server

Tags:

mysql

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?

like image 780
chi Avatar asked Sep 03 '25 15:09

chi


1 Answers

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

like image 77
Ryosaku Avatar answered Sep 05 '25 06:09

Ryosaku