Skip to content

Deleting Ubuntu + Debian Linux Database Tables

Deleting Ubuntu + Debian Linux Database Tables

For those of you who manage databases using Linux servers such as Ubuntu and Debian but without a GUI display, you will usually have difficulty when you want to interact with databases such as MySQL.

Here we provide some examples of commands how to delete a table using MySQL commands on Linux Ubuntu and Debian. For debian only, you may not need to use the “sudo” command, if you are already a “root” level Administrator.

If you want to enter as root on Debian, you can simply type the command “su” and then enter your password, after that you can use the following command to delete the table on the MySQL database on Linux Ubuntu or Debian.

Login to MySQL

sudo mysql -u root -p

Display All Database Names

SHOW DATABASES;

Enter to Database

USE database_name;

Displays All Table Names

SHOW TABLES;

Delete a Table

DROP TABLE table_name;

Here is a summary of how to delete database tables using mySQL commands present on Linux Debian and Ubuntu.

sudo mysql -u root -p
SHOW DATABASES;
USE database_name;
SHOW TABLES;
DROP TABLE table_name;

Leave a Reply

Your email address will not be published. Required fields are marked *