commands

Adding a new user to MySQL and other basic mysql commands

Crontab entry to backup all mysql databases to a file every midnight:
0 0 * * * mysqldump -u mjeltsch -h localhost --all-databases | gzip -9 > /home/mjeltsch/Documents/mysqldump.gz > /dev/null

Granting privileges to users connecting from localhost:
GRANT ALL PRIVILEGES ON *.* TO 'michael'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;

Granting privileges to users connecting from everywhere:
GRANT ALL PRIVILEGES ON *.* TO 'michael'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;