Commands
Config Path
mysql --help | grep -B 1 etc/my.cnf
Default options are read from the following files in the given order:
/etc/my.cnf /etc/mysql/my.cnf /opt/homebrew/etc/my.cnf ~/.my.cnf
mysqldump
With DB Creation
User --database
mysqldump -hlocalhost -uroot -P3306 -pcmajor --databases foo > db-2025-05-09-17-51.sql
Docker
docker run -d \
--name mysql-1 \
-p 3306:3306 \
-e MYSQL_ROOT_PASSWORD=123123 \
-v ~/mysql-data-1:/var/lib/mysql \
mysql:8.0.36