Backup mysql database from a running Docker

I try run command below for sqldumpl and backup mysql

sudo docker exec core_db_1 /usr/bin/mysqldump -u root -password=root mydb > backup.sql 

I got result error

mysqldump: [Warning] Using a password on the command line interface can be insecure.
mysqldump: Got error: 1045: Access denied for user 'root'@'localhost' (using password: YES) when trying to connect

so I don’t how to solve it.

Source: StackOverflow