{"id":1451,"date":"2017-01-10T07:13:13","date_gmt":"2017-01-10T07:13:13","guid":{"rendered":"http:\/\/www.fastwebhost.in\/blog\/?p=1451"},"modified":"2019-01-26T06:55:17","modified_gmt":"2019-01-26T06:55:17","slug":"how-to-delete-a-mysql-database-on-linux-via-command-line","status":"publish","type":"post","link":"https:\/\/www.fastwebhost.in\/blog\/how-to-delete-a-mysql-database-on-linux-via-command-line\/","title":{"rendered":"How to Delete a MySQL Database on Linux via Command Line"},"content":{"rendered":"<p>In this tutorial you are going to learn how to delete a MySQL database via command line on Linux server. Also, you&#8217;ll learn basic MySQL database operations through below steps.<\/p>\n<p>Let&#8217;s get straight to the point.<\/p>\n<h4>How to access MySQL command line or shell?<\/h4>\n<p>If MySQL server already installed on your server, then you can access it through shell or command line.<\/p>\n<p>First, login to the server as a root and then enter below command to access MySQL shell interface.<\/p>\n<p>You can use any of the below commands to access MySQL command line.<\/p>\n<p>mysqlmysql -u root -p<\/p>\n<p>In the above command u flag indicates root user, and -p flag for password authentication.<\/p>\n<p>You have to enter password to access MySQL.<\/p>\n<p>mysql&gt;<\/p>\n<h3>MySQL Database Command Line Basics<\/h3>\n<p><span><\/span><\/p>\n<ul data-unit=\"px\" style=\"margin-bottom: 10px !important;\">\n<li><a href=\"https:\/\/www.fastwebhost.in\/blog\/how-to-change-reset-mysql-root-password-linux-via-command-line\/amp\" target=\"_blank\">How to Change or Reset MySQL root Password via Command Line<\/a><\/li>\n<\/ul>\n<ul data-unit=\"px\" style=\"margin-bottom: 10px !important;\">\n<li style=\"margin-bottom: 10px !important; line-height: 17px;\"><a href=\"http:\/\/www.fastwebhost.in\/blog\/how-to-create-a-mysql-database-via-command-line\/\" target=\"_blank\">How to Create a MySQL Database via Command Line<\/a><\/li>\n<\/ul>\n<ul>\n<li style=\"margin-bottom: 0px !important;\"><a href=\"http:\/\/www.fastwebhost.in\/blog\/how-to-select-mysql-database-linux-via-command-line\/\" target=\"_blank\">How to Select a MySQL Database via Command Line<\/a><\/li>\n<\/ul>\n<ul>\n<li style=\"margin-bottom: 0px !important;\"><a href=\"http:\/\/www.fastwebhost.in\/blog\/how-to-delete-a-mysql-database-on-linux-via-command-line\" target=\"_blank\">How to Delete a MySQL Database via Command Line<\/a><\/li>\n<\/ul>\n<ul>\n<li style=\"margin-bottom: 0px !important;\"><a data-tcb-events=\"\" href=\"http:\/\/www.fastwebhost.in\/blog\/how-to-backup-mysql-databases-via-command-line\" rel=\"\" target=\"_blank\">How to Backup or Restore a MySQL Database via Command Line<\/a><\/li>\n<\/ul>\n<p>Now, you are ready to delete a database!<\/p>\n<h3>How to Delete or Drop MySQL Database?<\/h3>\n<p>You can&nbsp;delete\/drop a database with simple command. Keep in mind that you can&#8217;t undo delete once executed. You&#8217;ll lose all data in database.<\/p>\n<p>DROP DATABASE sampledb;<\/p>\n<p>The above command will drop or delete the database named &#8220;sampledb&#8221;. You may receive error if database doesn&#8217;t exist.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial you are going to learn how to delete a MySQL database via command line on Linux server. Also, you&#8217;ll learn basic MySQL database operations through below steps. Let&#8217;s get straight to the point. How to access MySQL command line or shell? If MySQL server already installed on your server, then you can [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":1459,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[22],"tags":[36],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.fastwebhost.in\/blog\/wp-json\/wp\/v2\/posts\/1451"}],"collection":[{"href":"https:\/\/www.fastwebhost.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.fastwebhost.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.fastwebhost.in\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.fastwebhost.in\/blog\/wp-json\/wp\/v2\/comments?post=1451"}],"version-history":[{"count":3,"href":"https:\/\/www.fastwebhost.in\/blog\/wp-json\/wp\/v2\/posts\/1451\/revisions"}],"predecessor-version":[{"id":4810,"href":"https:\/\/www.fastwebhost.in\/blog\/wp-json\/wp\/v2\/posts\/1451\/revisions\/4810"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.fastwebhost.in\/blog\/wp-json\/wp\/v2\/media\/1459"}],"wp:attachment":[{"href":"https:\/\/www.fastwebhost.in\/blog\/wp-json\/wp\/v2\/media?parent=1451"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.fastwebhost.in\/blog\/wp-json\/wp\/v2\/categories?post=1451"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.fastwebhost.in\/blog\/wp-json\/wp\/v2\/tags?post=1451"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}