{"id":7068,"date":"2019-04-26T12:49:18","date_gmt":"2019-04-26T09:49:18","guid":{"rendered":"http:\/\/unihost.com\/help\/?p=7068"},"modified":"2024-12-18T12:58:22","modified_gmt":"2024-12-18T09:58:22","slug":"import-and-export-databases-mysql-mariadb","status":"publish","type":"post","link":"https:\/\/unihost.com\/help\/import-and-export-databases-mysql-mariadb\/","title":{"rendered":"Import and Export Databases (MySQL, MariaDB)"},"content":{"rendered":"<p style=\"text-align: left;\"><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">To import\/export a MySQL\/MariaDB database, you will need access to a\u00a0 server with MySQL\/MariaDB, database name and user credentials for it.<\/span><!--more--><\/p>\n<p style=\"text-align: left;\"><span style=\"font-family: Ubuntu, sans-serif; font-size: 14pt;\">Export the database<\/span><\/p>\n<p style=\"text-align: left;\"><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">The\u00a0<strong>mysqldump<\/strong> client utility performs logical backups, producing a set of SQL statements that can be executed to reproduce the original database object definitions and table data.<\/span><\/p>\n<p style=\"text-align: left;\"><strong><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">#\u00a0 mysqldump -u <span style=\"color: #ff0000;\">username<\/span> -p <span style=\"color: #ff0000;\">database_name<\/span> &gt; <span style=\"color: #ff0000;\">dump_name.sql<\/span><\/span><\/strong><\/p>\n<p style=\"text-align: left;\"><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">It will export database to SQL text files.<\/span><\/p>\n<p style=\"text-align: left;\"><span style=\"font-family: Ubuntu, sans-serif; font-size: 14pt;\">Import the database<\/span><\/p>\n<p style=\"text-align: left;\"><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">To import a dump, you need to create a new database.\u00a0<\/span><\/p>\n<p style=\"text-align: left;\"><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">&#8211; log in as root or another user.<\/span><\/p>\n<p style=\"text-align: left;\"><strong><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"># mysql -u <span style=\"color: #ff0000;\">root<\/span> -p<\/span><\/strong><\/p>\n<p style=\"text-align: left;\"><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">&#8211; create a new database.<\/span><\/p>\n<p style=\"text-align: left;\"><strong><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\"># mysql &gt; CREATE DATABASE <span style=\"color: #ff0000;\">new_database<\/span>;<\/span><\/strong><\/p>\n<p style=\"text-align: left;\"><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">&#8211; exit the shell by pressing CTRL+D<\/span><br \/>\n<span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">&#8211; import the dump<\/span><\/p>\n<p style=\"text-align: left;\"><strong><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">#\u00a0 mysql -u <span style=\"color: #ff0000;\">username<\/span> -p <span style=\"color: #ff0000;\">database_name<\/span> &lt; <span style=\"color: #ff0000;\">dump_name.sql<\/span><\/span><\/strong><\/p>\n<p style=\"text-align: left;\"><span style=\"font-family: Ubuntu, sans-serif; font-size: 12pt;\">If the import runs successfully, you won&#8217;t get any output. If any errors occur during the process, MySQL will print them.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>To import\/export a MySQL\/MariaDB database, you will need access to a\u00a0 server with MySQL\/MariaDB, database name and user credentials for it.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[158],"tags":[474,473,472,118],"class_list":["post-7068","post","type-post","status-publish","format-standard","hentry","category-dedicated-servers","tag-export","tag-import","tag-mariadb","tag-mysql"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Import and Export Databases (MySQL, MariaDB) - Unihost.FAQ<\/title>\n<meta name=\"description\" content=\"To import\/export a MySQL\/MariaDB database, you will need access to a\u00a0 server with MySQL\/MariaDB, database name and user credentials for it\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/unihost.com\/help\/import-and-export-databases-mysql-mariadb\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Import and Export Databases (MySQL, MariaDB) - Unihost.FAQ\" \/>\n<meta property=\"og:description\" content=\"To import\/export a MySQL\/MariaDB database, you will need access to a\u00a0 server with MySQL\/MariaDB, database name and user credentials for it\" \/>\n<meta property=\"og:url\" content=\"https:\/\/unihost.com\/help\/import-and-export-databases-mysql-mariadb\/\" \/>\n<meta property=\"og:site_name\" content=\"Unihost.FAQ\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/unihost\/\" \/>\n<meta property=\"article:published_time\" content=\"2019-04-26T09:49:18+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-12-18T09:58:22+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/unihost.com\/help\/minio.php?.\/unihost-logo-alt.png\" \/>\n\t<meta property=\"og:image:width\" content=\"250\" \/>\n\t<meta property=\"og:image:height\" content=\"141\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Unihost Support\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@unihost\" \/>\n<meta name=\"twitter:site\" content=\"@unihost\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Unihost Support\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/unihost.com\/help\/import-and-export-databases-mysql-mariadb\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/unihost.com\/help\/import-and-export-databases-mysql-mariadb\/\"},\"author\":{\"name\":\"Unihost Support\",\"@id\":\"https:\/\/unihost.com\/help\/#\/schema\/person\/bb5ae95f38577c920e6a7507888b715a\"},\"headline\":\"Import and Export Databases (MySQL, MariaDB)\",\"datePublished\":\"2019-04-26T09:49:18+00:00\",\"dateModified\":\"2024-12-18T09:58:22+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/unihost.com\/help\/import-and-export-databases-mysql-mariadb\/\"},\"wordCount\":159,\"publisher\":{\"@id\":\"https:\/\/unihost.com\/help\/#organization\"},\"keywords\":[\"export\",\"import\",\"mariadb\",\"MySQL\"],\"articleSection\":[\"02. Dedicated servers\"],\"inLanguage\":\"en\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/unihost.com\/help\/import-and-export-databases-mysql-mariadb\/\",\"url\":\"https:\/\/unihost.com\/help\/import-and-export-databases-mysql-mariadb\/\",\"name\":\"Import and Export Databases (MySQL, MariaDB) - Unihost.FAQ\",\"isPartOf\":{\"@id\":\"https:\/\/unihost.com\/help\/#website\"},\"datePublished\":\"2019-04-26T09:49:18+00:00\",\"dateModified\":\"2024-12-18T09:58:22+00:00\",\"description\":\"To import\/export a MySQL\/MariaDB database, you will need access to a\u00a0 server with MySQL\/MariaDB, database name and user credentials for it\",\"breadcrumb\":{\"@id\":\"https:\/\/unihost.com\/help\/import-and-export-databases-mysql-mariadb\/#breadcrumb\"},\"inLanguage\":\"en\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/unihost.com\/help\/import-and-export-databases-mysql-mariadb\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/unihost.com\/help\/import-and-export-databases-mysql-mariadb\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Unihost\",\"item\":\"https:\/\/unihost.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Help\",\"item\":\"https:\/\/unihost.com\/help\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Import and Export Databases (MySQL, MariaDB)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/unihost.com\/help\/#website\",\"url\":\"https:\/\/unihost.com\/help\/\",\"name\":\"Unihost.FAQ\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/unihost.com\/help\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/unihost.com\/help\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/unihost.com\/help\/#organization\",\"name\":\"Unihost\",\"alternateName\":\"Unihost\",\"url\":\"https:\/\/unihost.com\/help\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en\",\"@id\":\"https:\/\/unihost.com\/help\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/unihost.com\/help\/minio.php?2026\/01\/minio.png\",\"contentUrl\":\"https:\/\/unihost.com\/help\/minio.php?2026\/01\/minio.png\",\"width\":300,\"height\":300,\"caption\":\"Unihost\"},\"image\":{\"@id\":\"https:\/\/unihost.com\/help\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/unihost\/\",\"https:\/\/x.com\/unihost\",\"https:\/\/www.instagram.com\/unihost\/?hl=en\",\"https:\/\/www.linkedin.com\/company\/unihost-com\",\"https:\/\/www.youtube.com\/channel\/UCITKsxMDnslQY8brN3advgw\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/unihost.com\/help\/#\/schema\/person\/bb5ae95f38577c920e6a7507888b715a\",\"name\":\"Unihost Support\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en\",\"@id\":\"https:\/\/unihost.com\/help\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/a0c9db17c2a0d93e8a0d5ac123f8c5db750ad4d3d5657369c0c4e480f5af77b8?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/a0c9db17c2a0d93e8a0d5ac123f8c5db750ad4d3d5657369c0c4e480f5af77b8?s=96&d=mm&r=g\",\"caption\":\"Unihost Support\"},\"sameAs\":[\"https:\/\/unihost.com\/\"],\"url\":\"https:\/\/unihost.com\/help\/author\/support\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Import and Export Databases (MySQL, MariaDB) - Unihost.FAQ","description":"To import\/export a MySQL\/MariaDB database, you will need access to a\u00a0 server with MySQL\/MariaDB, database name and user credentials for it","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/unihost.com\/help\/import-and-export-databases-mysql-mariadb\/","og_locale":"en_US","og_type":"article","og_title":"Import and Export Databases (MySQL, MariaDB) - Unihost.FAQ","og_description":"To import\/export a MySQL\/MariaDB database, you will need access to a\u00a0 server with MySQL\/MariaDB, database name and user credentials for it","og_url":"https:\/\/unihost.com\/help\/import-and-export-databases-mysql-mariadb\/","og_site_name":"Unihost.FAQ","article_publisher":"https:\/\/www.facebook.com\/unihost\/","article_published_time":"2019-04-26T09:49:18+00:00","article_modified_time":"2024-12-18T09:58:22+00:00","og_image":[{"width":250,"height":141,"url":"https:\/\/unihost.com\/help\/minio.php?.\/unihost-logo-alt.png","type":"image\/png"}],"author":"Unihost Support","twitter_card":"summary_large_image","twitter_creator":"@unihost","twitter_site":"@unihost","twitter_misc":{"Written by":"Unihost Support","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/unihost.com\/help\/import-and-export-databases-mysql-mariadb\/#article","isPartOf":{"@id":"https:\/\/unihost.com\/help\/import-and-export-databases-mysql-mariadb\/"},"author":{"name":"Unihost Support","@id":"https:\/\/unihost.com\/help\/#\/schema\/person\/bb5ae95f38577c920e6a7507888b715a"},"headline":"Import and Export Databases (MySQL, MariaDB)","datePublished":"2019-04-26T09:49:18+00:00","dateModified":"2024-12-18T09:58:22+00:00","mainEntityOfPage":{"@id":"https:\/\/unihost.com\/help\/import-and-export-databases-mysql-mariadb\/"},"wordCount":159,"publisher":{"@id":"https:\/\/unihost.com\/help\/#organization"},"keywords":["export","import","mariadb","MySQL"],"articleSection":["02. Dedicated servers"],"inLanguage":"en"},{"@type":"WebPage","@id":"https:\/\/unihost.com\/help\/import-and-export-databases-mysql-mariadb\/","url":"https:\/\/unihost.com\/help\/import-and-export-databases-mysql-mariadb\/","name":"Import and Export Databases (MySQL, MariaDB) - Unihost.FAQ","isPartOf":{"@id":"https:\/\/unihost.com\/help\/#website"},"datePublished":"2019-04-26T09:49:18+00:00","dateModified":"2024-12-18T09:58:22+00:00","description":"To import\/export a MySQL\/MariaDB database, you will need access to a\u00a0 server with MySQL\/MariaDB, database name and user credentials for it","breadcrumb":{"@id":"https:\/\/unihost.com\/help\/import-and-export-databases-mysql-mariadb\/#breadcrumb"},"inLanguage":"en","potentialAction":[{"@type":"ReadAction","target":["https:\/\/unihost.com\/help\/import-and-export-databases-mysql-mariadb\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/unihost.com\/help\/import-and-export-databases-mysql-mariadb\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Unihost","item":"https:\/\/unihost.com\/"},{"@type":"ListItem","position":2,"name":"Help","item":"https:\/\/unihost.com\/help\/"},{"@type":"ListItem","position":3,"name":"Import and Export Databases (MySQL, MariaDB)"}]},{"@type":"WebSite","@id":"https:\/\/unihost.com\/help\/#website","url":"https:\/\/unihost.com\/help\/","name":"Unihost.FAQ","description":"","publisher":{"@id":"https:\/\/unihost.com\/help\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/unihost.com\/help\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en"},{"@type":"Organization","@id":"https:\/\/unihost.com\/help\/#organization","name":"Unihost","alternateName":"Unihost","url":"https:\/\/unihost.com\/help\/","logo":{"@type":"ImageObject","inLanguage":"en","@id":"https:\/\/unihost.com\/help\/#\/schema\/logo\/image\/","url":"https:\/\/unihost.com\/help\/minio.php?2026\/01\/minio.png","contentUrl":"https:\/\/unihost.com\/help\/minio.php?2026\/01\/minio.png","width":300,"height":300,"caption":"Unihost"},"image":{"@id":"https:\/\/unihost.com\/help\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/unihost\/","https:\/\/x.com\/unihost","https:\/\/www.instagram.com\/unihost\/?hl=en","https:\/\/www.linkedin.com\/company\/unihost-com","https:\/\/www.youtube.com\/channel\/UCITKsxMDnslQY8brN3advgw"]},{"@type":"Person","@id":"https:\/\/unihost.com\/help\/#\/schema\/person\/bb5ae95f38577c920e6a7507888b715a","name":"Unihost Support","image":{"@type":"ImageObject","inLanguage":"en","@id":"https:\/\/unihost.com\/help\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/a0c9db17c2a0d93e8a0d5ac123f8c5db750ad4d3d5657369c0c4e480f5af77b8?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/a0c9db17c2a0d93e8a0d5ac123f8c5db750ad4d3d5657369c0c4e480f5af77b8?s=96&d=mm&r=g","caption":"Unihost Support"},"sameAs":["https:\/\/unihost.com\/"],"url":"https:\/\/unihost.com\/help\/author\/support\/"}]}},"_links":{"self":[{"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/posts\/7068","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/comments?post=7068"}],"version-history":[{"count":4,"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/posts\/7068\/revisions"}],"predecessor-version":[{"id":16936,"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/posts\/7068\/revisions\/16936"}],"wp:attachment":[{"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/media?parent=7068"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/categories?post=7068"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unihost.com\/help\/wp-json\/wp\/v2\/tags?post=7068"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}