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