Sometimes I need to dump MySQL data from servers where I have read-only access. When I run standard mysqldump, then it fails because it tries to lock the tables. Here’s how to dump without locking:
/usr/local/mysql/bin/mysqldump -u my-user -h my-server -p -O lock-tables=FALSE db-name >db-dump.sql