{"id":3438,"date":"2009-12-14T17:07:13","date_gmt":"2009-12-14T21:07:13","guid":{"rendered":"https:\/\/apps4rent.com\/support\/?p=3438"},"modified":"2013-05-28T05:48:44","modified_gmt":"2013-05-28T09:48:44","slug":"how-can-i-create-database-from-sql-backup-file","status":"publish","type":"post","link":"https:\/\/www.apps4rent.com\/support\/kb\/article\/how-can-i-create-database-from-sql-backup-file","title":{"rendered":"How can I create a database from a SQL backup file?"},"content":{"rendered":"<p>To create a database from a SQL backup file, follow these instructions:<\/p>\n<p>First, create the database.<\/p>\n<p>\/path\/to\/bin\/mysqladmin -u $mysqlusername -p$mysqlpassword create $mysqldatabasename<\/p>\n<p>Then, add user permission to it.<br \/>\n\/path\/to\/bin\/mysqladmin -u usernamehere -ppasshere create databasename<\/p>\n<p>Finally, add the tables back:<br \/>\n\/path\/to\/bin\/mysql -u $mysqlusername -p$mysqlpassword $mysqldatabasename &lt; backup.sql<br \/>\nOR:<br \/>\nmysql -u user -p -e &#8216;source backup_file&#8217; database<\/p>\n<p>Related links:<\/p>\n<p><strong>Related Links:<\/strong><\/p>\n<p><a title=\"MOSS Hosting\" href=\"http:\/\/www.apps4rent.com\/microsoft-office-sharepoint-server-moss-2007-hosting\/moss-2007-sharepoint.html\">MOSS Hosting<\/a><\/p>\n<p><a title=\"Hyper-V Hosting\" href=\"http:\/\/www.apps4rent.com\/Server-Virtualization-VPS-Software-Hosting\/Microsoft-Hyper-V-2008\/hyper-v-hosting.html\" target=\"_blank\">Windows Hyper-V Hosting<\/a><\/p>\n<p><a title=\"Virtual Dedicated Servers\" href=\"http:\/\/www.apps4rent.com\/virtual-dedicated-private-server-windows-hyper-v-vds-vs-vps-hosting\/virtual-dedicated-server.html\" target=\"_blank\">Virtual Dedicated Servers (VDS)<\/a><\/p>\n<p><a title=\"Hyper-V Price Plans\" href=\"http:\/\/www.apps4rent.com\/Hyper-V-Hosting-Services-Pricing-Plans\/hyperv-hostingplans.html\" target=\"_blank\">Hyper-V Price Plans<\/a><\/p>\n<p><a title=\"Hyper-V Features\" href=\"http:\/\/www.apps4rent.com\/Hosting-Hyper-V-Virtualization-Server-Virtual-Private-Architecture-Features\/hyperv-features.html\" target=\"_blank\">Hyper-V Features<\/a><\/p>\n<p><a title=\"Server Administration Plan\" href=\"http:\/\/www.apps4rent.com\/server-administration-managed-services-plans-hyper-v-kaseya-hosting.html\">Server Administration Plan<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>To create a database from a SQL backup file, follow these instructions: First, create the database. \/path\/to\/bin\/mysqladmin -u $mysqlusername -p$mysqlpassword create $mysqldatabasename Then, add user permission to it. \/path\/to\/bin\/mysqladmin -u usernamehere -ppasshere create databasename Finally, add the tables back: \/path\/to\/bin\/mysql -u $mysqlusername -p$mysqlpassword $mysqldatabasename &lt; backup.sql OR: mysql -u user -p -e &#8216;source backup_file&#8217; database [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1056,1054],"tags":[],"class_list":["post-3438","post","type-post","status-publish","format-standard","hentry","category-hyper-v","category-virtual-servers"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.apps4rent.com\/support\/wp-json\/wp\/v2\/posts\/3438","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.apps4rent.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.apps4rent.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.apps4rent.com\/support\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.apps4rent.com\/support\/wp-json\/wp\/v2\/comments?post=3438"}],"version-history":[{"count":0,"href":"https:\/\/www.apps4rent.com\/support\/wp-json\/wp\/v2\/posts\/3438\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.apps4rent.com\/support\/wp-json\/wp\/v2\/media?parent=3438"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.apps4rent.com\/support\/wp-json\/wp\/v2\/categories?post=3438"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.apps4rent.com\/support\/wp-json\/wp\/v2\/tags?post=3438"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}