Showing posts with label mysql. Show all posts
Showing posts with label mysql. Show all posts

Monday, November 1, 2010

Backing up and restoring a mySql database

1. Create backup

$ mysqldump -u root -proot regdb > /home/yumani/Documents/regdb_back.sql


2. Restore

Create a database in mysql and the grant user access
mysql >  create database regdb;
mysql >  grant all on regdb.* to wso2bam@'%' identified by 'wso2bam';

$ mysql -u root -proot regdb < /home/yumani/Documents/regdb_back.sql

Tuesday, October 12, 2010

Removing mySQL

sudo apt-get remove mysql-server
sudo apt-get autoremove mysql-server
sudo apt-get --purge remove mysql-server

same for mysql-client.

Tuesday, May 11, 2010

mySQL - basics

A note copied from someone blogged in web . Was extremely handy when I was picking mysql commands from here and there ...


Install MySql database:
sudo apt-get install mysql-server

Start MySql server:
/etc/init.d/mysql start

Stop MySql server:
/etc/init.d/mysql stop

Restart MySql server:
/etc/init.d/mysql restart

Check the status of  MySql server:
/etc/init.d/mysql status

List mysql packages
dpkg -l mysql

uninstall mysql server

 apt-get --purge remove mysql-server-5.0

re-install mysql server
 apt-get --reinstall install mysql-server-5.0

 Invoking mysql command-line tool
mysql --user=user_name --password=your_password db_name 


To allow remote connections
http://www.debianhelp.co.uk/remotemysql.htm

Day 03 Gala Dinner Highlight Video