Vic/MySQL

From Summerseas

Jump to: navigation, search

MySQL Notes

Backups

  • A simple mysqldump like the following works nicely.
for d in wikidb test mysql family information_schema
do 
   mysqldump -u root -pMyPassword $d  > backups/mysql/${d}.sql
done
  • Note - With the -p switch for password, there can be no space between the 'p' and the password.

Database and User Creation

  • mysql> create database newDB;
    • Query OK, 1 row affected (0.05 sec)
  • mysql> GRANT ALL ON newDB.* TO newuser@localhost IDENTIFIED BY "password";
    • Query OK, 0 rows affected (0.08 sec)
Personal tools