In this use case we are using the jamesDump.sql stored at /home/gaurav/Desktop/jamesDump.sql file to create a new database named intelligrape.
First of all we need to login to the mysql prompt.
gaurav@gaurav:~$ mysql -u root -p Enter Password: ****** Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 30 Server version: 5.0.51a-3ubuntu5.4 (Ubuntu) Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql >
Here we need to create a new database named intelligrape which will replicate the old database
mysql > create database intelligrape; Query OK, 1 row affected (0.02 sec) mysql > use intelligrape; //set intelligrape database as the current database in use Database changed mysql > source ~/Desktop/jamesDump.sql //source command will read the script and copy the schema as well as the values from dumpfile into the database. Query OK, 0 rows affected (0.02 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) mysql > show tables //it will show the list of all tables of intelligrape database created by dumpfile.
Hope it helps.