Technical
Mysqldump Without Table Locking

I had a case where I had read only permissions for mysql server however I had to do dump and would get:


 Access denied for user ''@'%' to database 'comdb_production' when doing LOCK TABLES

To overcome that I used—skip-lock-table:


 mysqldump --skip-lock-tables -u root -p  db_dev users >  users.sql

Also, you can do a conditional dump.


 mysqldump --skip-lock-tables -u root -p  db_dev --table users --where="name like '%jhon%'"  >  users.sql

To skip certain tables(—ignore-table)


 mysqldump -u root -p db --skip-lock-table --ignore-table db.orders
NOTE:it’s important to use db prefix for ignored tables. Also it’s very important to have a correct spelling otherwise mysqldump will still pull them.