{"id":46,"date":"2009-04-16T18:29:31","date_gmt":"2009-04-16T12:59:31","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=46"},"modified":"2016-12-19T15:28:30","modified_gmt":"2016-12-19T09:58:30","slug":"creating-a-new-database-from-a-mysql-dump-file","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/creating-a-new-database-from-a-mysql-dump-file\/","title":{"rendered":"Creating a new Database from a mysql dump file"},"content":{"rendered":"<p>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.<\/p>\n<p>First of all we need to login to the mysql prompt.<\/p>\n<pre lang=\"groovy\">\r\ngaurav@gaurav:~$ mysql -u root -p\r\nEnter Password: ******\r\nWelcome to the MySQL monitor.\u00a0 Commands end with ; or \\g.\r\nYour MySQL connection id is 30\r\nServer version: 5.0.51a-3ubuntu5.4 (Ubuntu)\r\n\r\nType 'help;' or '\\h' for help. Type '\\c' to clear the buffer.\r\n\r\nmysql > <\/pre>\n<p>Here we need to create a new database named intelligrape which will replicate the old database<\/p>\n<pre lang=\"groovy\">\r\nmysql >  create database intelligrape;\r\nQuery OK, 1 row affected (0.02 sec)\r\n\r\nmysql >  use intelligrape;\u00a0\u00a0\u00a0 \/\/set intelligrape database as the current database in use\r\nDatabase changed\r\n\r\nmysql > source ~\/Desktop\/jamesDump.sql\u00a0\u00a0\u00a0 \/\/source command will read the script and copy the schema as well as the values from dumpfile into the database.\r\nQuery OK, 0 rows affected (0.02 sec)\r\n\r\nQuery OK, 0 rows affected (0.00 sec)\r\n\r\nQuery OK, 0 rows affected (0.00 sec)\r\n\r\nQuery OK, 0 rows affected (0.00 sec)\r\n\r\nmysql > show tables\u00a0\u00a0\u00a0 \/\/it will show the list of all tables of intelligrape database created by dumpfile.<\/pre>\n<p>Hope it helps.<\/p>\n<p>Gaurav Chauhan<br \/>\ngaurav@intelligrape.com<\/p>\n<p><a href=\"http:\/\/www.tothenew.com\/blog\/\">http:\/\/www.IntelliGrape.com\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>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.\u00a0 Commands end with ; or \\g. Your MySQL connection id is [&hellip;]<\/p>\n","protected":false},"author":9,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":95},"categories":[1],"tags":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/46"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=46"}],"version-history":[{"count":0,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/46\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=46"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=46"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=46"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}