Install Mysql 5.5 on Ubuntu 12.04 - lifuzu/cafe GitHub Wiki
- Run the following command to install mysql programs (include client and server):
sudo apt-get install mysql-server
- Run the following command from a terminal prompt to check whether the MySQL server is running:
sudo netstat -tap | grep mysql
- Run the following command to enter mysql server (type the password you set up in step 1):
mysql -u root -p
- Create database, user and grant permissions:
CREATE USER 'username'@'localhost' IDENTIFIED BY '********';
CREATE DATABASE database_name;
GRANT ALL ON database_name.* TO 'username'@'localhost';
FLUSH PRIVILEGES;
mysql --user=username --password=PASSWORD -Bse "show databases like '%reviewdb'"
mysqldump --user=USERNAME --password=PASSWORD --single-transaction --extended-insert=FALSE --complete-insert=TRUE --order-by-primary --databases db_name > backup_database_db_name_111413.sql
mysqldump --user=USERNAME --password=PASSWORD --single-transaction --extended-insert=FALSE --complete-insert=TRUE --order-by-primary --all-databases > backup_all_databases_111413.sql
##References: