Skip to content

Instantly share code, notes, and snippets.

@abelcallejo
Last active July 28, 2020 21:33
Show Gist options
  • Save abelcallejo/5fb87810df66758add19e1ee80ea263a to your computer and use it in GitHub Desktop.
Save abelcallejo/5fb87810df66758add19e1ee80ea263a to your computer and use it in GitHub Desktop.
PostgreSQL and MySQL CLI Cheatsheet

PostgreSQL and MySQL CLI Cheatsheet

MySQL dump

mysqldump -h hostname -P 3306 -u user -p database > /path/to/dumpedfile.sql

or

mysqldump -h hostname -P 3306 -u user --password=e\$capedpassword database > /path/to/dumpedfile.sql

MySQL

my.cnf

Location:

~/.my.cnf

Content:

[client]
host="localhost"
port="3306"
user="bill"
password="g4te5"

Usage

mysql < /path/to/mysql/script.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment