121

By mistake, I have created a duplicate database in the phpMyAdmin page of cPanel. I want to delete this database, but I am not able to find any delete button in the UI.

How to delete a database in phpMyAdmin?

coder
  • 1,809
  • 4
  • 19
  • 24

17 Answers17

136

On phpMyAdmin 4.1.9:

database_name > Operations > Remove database

enter image description here

Mars Robertson
  • 12,673
  • 11
  • 68
  • 89
  • 12
    For what it's worth - not available within the PHP MyAdmin window I'm getting from my ISP :( – RedYeti Feb 18 '15 at 14:51
  • 1
    If it is not in your PHPMyAdmin, you might have another option off your cPannel, "My SQL Databases". My ISP uses 2 different links for options that are available in PHPMyAdmin on other ISPs – BillyNair Mar 02 '15 at 10:18
  • 1
    IMHO, it is only availabe for users with global privilage to drop the database. Otherwise, simply it wont be there. I checked in local enviornment, IMHO, it might be in production enviornment too. – Ajeeb.K.P Jul 20 '15 at 11:38
  • 1
    any reason why they just don't have a 'delete' button in a more intuitive location? Llike the databases homepage. – Jon Grah Mar 10 '17 at 03:03
  • 1
    Why isn't this the accepted answer? The accepted answer is about deleting it in cpanel - NOT about deleting from phpmyadmin which is what the question asked, and the question I was actually looking for the answer to. And, this worked by the way. In cpanel for some reason, those databases were not showing up, my reason for searching for this. – programmingaddict Feb 20 '20 at 00:46
78

After successful login to cPanel, near to the phpMyAdmin icon there is another icon MySQL Databases; click on that.

enter image description here

That brings you to the database listing page.

In the action column you can find the delete database option click on that to delete your database!

Christian
  • 22,585
  • 9
  • 80
  • 106
psanjib
  • 1,255
  • 2
  • 15
  • 24
  • 5
    This is outdated. There is no action column in the phpMyAdmin that I'm using... Please update your answer. – oldboy Sep 13 '17 at 21:13
  • 8
    Why assume that everyone uses cPanel? And why give a cPanel answer to a PHPmyAdmin question? – Mawg says reinstate Monica Nov 01 '17 at 12:09
  • 2
    @MAwg you are absolutely right, i agree with you. As the use mention on his question that "I have created a duplicate database in the phpMyAdmin page of cPanel" that why i gave cpanel answer – psanjib Apr 25 '18 at 11:14
30

Screenshot

  1. Go to phpmyadmin home page.
  2. Click on 'Databases'.
  3. Select the database you want to delete. (put check mark)
  4. Click Drop.
Sunil Kumar
  • 6,112
  • 6
  • 36
  • 40
user3642940
  • 421
  • 4
  • 4
  • 1
    there are no such options on server side and you should quit the phpmyadmin and delete the db entirely from hosting's panel on server. – CodeToLife Jan 27 '21 at 17:36
21

Taking a queue from michael's answer above, I was unable to find the DROP Database command on my phpMyAdmin console in the localhost.

Apparantly I was missing a setting. Go to config.inc.php file of the phpMyAdmin folder, and add this:

$cfg['AllowUserDropDatabase'] = true;

Save and restart the local server and the command appears inside the console.

Community
  • 1
  • 1
codegasm
  • 676
  • 1
  • 8
  • 21
8

If you want to delete your database from phpmyAdmin or mySQl. Simply go to SQL command and write command "drop DATABASE databasename;"

Example: drop DATABASE rainbowonlineshopping;

enter image description here

Then click on "Go" Button. Your Database will be deleted and you get information like this

enter image description here

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
  • 1
    there are no drop or delete buttons in my new phpmyadmin. So this answer still the only correct. **2020 y** – CodeToLife Feb 18 '20 at 02:57
  • On Siteground even this is disabled. But Googling specifically for Siteground gives a tutorial (horribly long URL, and it may change) that one does it in Site Tools. When doing domain transfers this does have the advantage that one can see which site one is on, which is not the case within PHPmyAdmin. – zsalya Nov 23 '22 at 15:31
7

You can delete the database in Cpanel.

In Cpanel go to databases and there you will see all created databases and you can delete this database.

http://docs.cpanel.net/twiki/bin/view/AllDocumentation/CpanelDocs/MySQLDatabases#Delete a Database

or other wise on live server if user have privileges you can run command in sql tab of phpmyadmin.

drop database databasename;
Maz I
  • 3,664
  • 2
  • 23
  • 38
7

You can follow uploaded images

enter image description here

Then select which database you want to delete

enter image description here

Petter Friberg
  • 21,252
  • 9
  • 60
  • 109
4
  1. Connect to your localhost.
  2. Open your favorite browser.
  3. Make sure your localhost is working.
  4. Type in url= localhost.
  5. Scroll down click on phpadmin once phpadmin is open.
  6. Click on database.
  7. Mark check the database you want remove.
  8. Click on drop.

If this don't work

  1. Click on database go to operation
  2. Click drop database

enter image description here

Mona Jalal
  • 34,860
  • 64
  • 239
  • 408
Edgardasun
  • 63
  • 1
  • 9
4

database_name -> Operations -> Remove database -> click on drop the database (DROP)

Vayodya Tamari
  • 285
  • 2
  • 2
3

There are two ways for delete Database

  1. Run this SQL query -> DROP DATABASE database_name
  2. Click database_name -> Operations ->Remove Database
umutekici
  • 31
  • 2
3

Open the Terminal and run

 mysql -u root -p

Password is null or just enter your mysql password

Ater Just Run This Query

 DROP DATABASE DBname;

If you are using phpmyadmin then just run

 DROP DATABASE DBname;
Shabeer K
  • 1,489
  • 16
  • 23
3

Follow the following steps to delete database in PhpMyAdmin.

  1. Select your database.
  2. Choose the "Operations" tab.
  3. On this page under remove database, you will find a "Drop the database (DROP)"

Hope this helps.

Rajneesh Shukla
  • 1,048
  • 13
  • 21
2

How to delete a database in phpMyAdmin?

From the Operations tab of the database, look for (and click) the text Drop the database (DROP).

Isaac Bennetch
  • 11,830
  • 2
  • 32
  • 43
2

select database on the left side. Then on the right-central top you can find Operations. In that go for remove database (DROP). That's all.

S K padala
  • 251
  • 2
  • 3
  • 16
2

The delete / drop option in operations is not present in my version.

Go to CPanel -> MySQLDatabase (icon next to PhPMyAdmin) -> check the DB to be delete -> delete.

user2060451
  • 2,576
  • 3
  • 24
  • 31
1

Go to operations tab for the selected database and click "Drop the database (DROP)" to delete it.

Bilal
  • 517
  • 5
  • 7
1

It will work 100%. Go to your xampp installation directory.

`D:\xampp\phpMyAdmin\libraries\config.default.php`

Steps:

Step1: Go the line number 777 and replace this

$cfg['AllowUserDropDatabase'] = false; to $cfg['AllowUserDropDatabase'] = true;

Step2: restart the xampp

Problem image

Solution Image

Kaleemullah
  • 446
  • 3
  • 8