Skip to content

TechDirectArchive

Hands-on IT, Cloud, Security & DevOps Insights

  • Home
  • About
  • Advertise With US
  • Reviews
  • Contact
  • Toggle search form
Home » Oracle/MSSQL/MySQL » How to delete and create MySQL Databases
  • featured image
    How to Add or Remove Sites from Favorites list in Microsoft Edge Windows
  • image 26
    Add an EBS volume to AWS EC2 via the AWS Console and CLI AWS/Azure/OpenShift
  • veeam
    Install Veeam Backup And Replication With Dedicated SQL Server Backup
  • FailedRegistration
    DNS Bad key 9017: The Cluster Name registration failed of one or more associated DNS names Virtualization
  • banner
    Prevent Microsoft Edge from sending your Search data to Microsoft Windows
  • Licensing
    Manage Windows Product key with Software Licensing Manager Windows
  • whatsappImage
    How to add WhatsApp UWP on Windows 11 Windows
  • ffd
    Unable to bind to LDAP or AD in Pleasant Password Server Password Manager

How to delete and create MySQL Databases

Posted on 08/04/202320/06/2025 Christian By Christian No Comments on How to delete and create MySQL Databases
How-to-create-and-delete-MySQL-database

In this article, I will show you how to delete and create MySQL Databases. According to Wiki, MySQL is an open-source relational database management system. A database (DB) is used to store the collection of records in an organized form. It allows us to hold the data into tables, rows, columns, and indexes to find the relevant information frequently. Here are some exciting guides: How to update WampServer to Latest Version, and how to Generate SSH keys in Windows 11.

Please, see how to stop Docker from automatically starting on Mac, how To Set Up Public Load Balancer in Azure, and How to enable or disable Secure Boot in Windows.

Drop a MySQL Database

The DROP DATABASE (DB) statement drops all tables in the database and deletes the database permanently. Therefore, you need to be very careful when using this statement. The following shows the syntax of the DROP DATABASE statement.

DROP DATABASE database_name;
run-query-to-drop-db

In this statement, you specify the name of the database which you want to delete after the DROP DATABASE keywords.

DB Deleted

As you can see below, the database has been deleted.

drop-mysql-db

MySQL Remove DATABASE using MySQL Client

Note: Just as you can delete databases with DROP. You can use DROP to delete a user altogether as discussed here in “How to delete a MySQL User Account“. Please also see how to check and assign privileges to a MySQL User.

First, log in to the MySQL Server using the root user or with the useraccount that has the privilege to drop the database.

mysql>mysql -u [username]-p
mysql -u root -p

Next, you will have to display all the databases using the SHOW DATABASES statement:

SHOW DATABASES;

We will have to drop the DB we wish from the output above. We will now have to TechDADb by issuing the DROP DATABASE statement.

DROP DATABASE TechDADb;

To log out, type the following command “quit“.

mysql>quit

Note: You can also use the MySQL Workbench for this dropping and creating a new user account on MySQL.

Please see these related articles: How to access MySQL Server from command Prompt, Debugging: How to debug a PowerShell script, and how to download your MySQL database from Azure to a local PC with MySQL Workbench.

Create a MySQL database from the phpMyAdmin

Launch the phpMyAdmin interface, and click on the Database Menu. Enter the Database name, select the Collation and hit the Create button.

This will ensure the database is created. 
newcollation

Note: Users are assigned to databases by editing the user record (from the User accounts link on the home page). If you are creating a user specifically for a given table you will have to create the user first (with no global privileges) and then go back and edit that user to add the table and privileges for the individual table.

Create a MySQL Database via the MySQL Commandline Client

Log in to the MySQL server as discussed above. Ensure to replace the name TechDA with your database name.

CREATE DATABASE TechDA;

To check the created database, please use the following query.

SHOW DATABASES; 

I hope you found this blog post helpful on how to delete and create MySQL Databases. If you have any questions, please let me know in the comment section.

5/5 - (1 vote)

Thank you for reading this post. Kindly share it with others.

  • Click to share on X (Opens in new window) X
  • Click to share on Reddit (Opens in new window) Reddit
  • Click to share on LinkedIn (Opens in new window) LinkedIn
  • Click to share on Facebook (Opens in new window) Facebook
  • Click to share on Pinterest (Opens in new window) Pinterest
  • Click to share on Tumblr (Opens in new window) Tumblr
  • Click to share on Telegram (Opens in new window) Telegram
  • Click to share on WhatsApp (Opens in new window) WhatsApp
  • Click to share on Pocket (Opens in new window) Pocket
  • Click to share on Mastodon (Opens in new window) Mastodon
  • Click to share on Bluesky (Opens in new window) Bluesky
  • Click to share on Threads (Opens in new window) Threads
  • Click to share on Nextdoor (Opens in new window) Nextdoor
Oracle/MSSQL/MySQL Tags:MySQL database, Windows 10, Windows 11, Windows Server 2016

Post navigation

Previous Post: How to check and assign privileges to a MySQL User
Next Post: Visualize MBAM Recovery Audit Report with Python

Related Posts

  • Screenshot 2020 06 23 at 10.52.52
    How to uninstall Microsoft SQL Server on Windows Oracle/MSSQL/MySQL
  • Enable or disable SA acocunt
    How to enable an SA account that has been disabled Oracle/MSSQL/MySQL
  • Migrate from SQL Database
    Migrate Veeam One Database from SQL Server 2017 to 2025 Backup
  • azure app service with office 365 and yammer sharepoint saturday florence 2015 session 8 638
    WordPress site on Azure: How to create a website hosted in Azure Oracle/MSSQL/MySQL
  • Screenshot 2020 06 22 at 23.27.40 1
    Install MSSQL 2019 Developer Edition and SSMS on Windows Oracle/MSSQL/MySQL
  • sql server installation
    How to Install all Editions of Microsoft SQL Server 2025 Oracle/MSSQL/MySQL

More Related Articles

Screenshot 2020 06 23 at 10.52.52 How to uninstall Microsoft SQL Server on Windows Oracle/MSSQL/MySQL
Enable or disable SA acocunt How to enable an SA account that has been disabled Oracle/MSSQL/MySQL
Migrate from SQL Database Migrate Veeam One Database from SQL Server 2017 to 2025 Backup
azure app service with office 365 and yammer sharepoint saturday florence 2015 session 8 638 WordPress site on Azure: How to create a website hosted in Azure Oracle/MSSQL/MySQL
Screenshot 2020 06 22 at 23.27.40 1 Install MSSQL 2019 Developer Edition and SSMS on Windows Oracle/MSSQL/MySQL
sql server installation How to Install all Editions of Microsoft SQL Server 2025 Oracle/MSSQL/MySQL

Leave a Reply Cancel reply

You must be logged in to post a comment.

Microsoft MVP

VEEAMLEGEND

vexpert-badge-stars-5

Virtual Background

GoogleNews

Categories

veeaam100

sysadmin top30a

  • featured image
    How to Add or Remove Sites from Favorites list in Microsoft Edge Windows
  • image 26
    Add an EBS volume to AWS EC2 via the AWS Console and CLI AWS/Azure/OpenShift
  • veeam
    Install Veeam Backup And Replication With Dedicated SQL Server Backup
  • FailedRegistration
    DNS Bad key 9017: The Cluster Name registration failed of one or more associated DNS names Virtualization
  • banner
    Prevent Microsoft Edge from sending your Search data to Microsoft Windows
  • Licensing
    Manage Windows Product key with Software Licensing Manager Windows
  • whatsappImage
    How to add WhatsApp UWP on Windows 11 Windows
  • ffd
    Unable to bind to LDAP or AD in Pleasant Password Server Password Manager

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 1,836 other subscribers
  • RSS - Posts
  • RSS - Comments
  • About
  • Authors
  • Write for us
  • Advertise with us
  • General Terms and Conditions
  • Privacy policy
  • Feedly
  • Telegram
  • Youtube
  • Facebook
  • Instagram
  • LinkedIn
  • Tumblr
  • Pinterest
  • Twitter
  • mastodon

Tags

Active Directory AWS Azure Bitlocker Microsoft Windows PowerShell WDS Windows 10 Windows 11 Windows Server 2016

Copyright © 2025 TechDirectArchive

 

Loading Comments...
 

You must be logged in to post a comment.