可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
I was alerted by my hosting provider that I exceed my 1000 table limit. I have a lot of databases and would like to delete more at once. Unfortunaltley they don't have a multiselect feature so I decided to use a query in phpmyadmin.
When I try something like DROP database some_name
I get DROP DATABASE statements are disables
Does anyone know if it's possible to enable them or a different way to delete multiple databases?
回答1:
It looks like there is a phpMyAdmin setting that you need to edit in config.inc.php.
boolean $cfg['AllowUserDropDatabase'] (line 503)
show a 'Drop database' link to normal users
回答2:
Yes, you can do it with the following steps:
Go to wamp/apps/phpmyadmin3.5.1/libraries
Open the file called "config.default.php"
Go to line 653 and change $cfg['AllowUserDropDatabase'] = false;
to true
Restart the server to see the changes
For Windows XP users: if the effect is not reflected, exit WAMP through the quick launch icon and try restarting it.
回答3:
Without touching any config files
If you have your phpmyadmin open, on the left side you'll see a database icon right next to your home icon( if you mouse over it - 'query window' title will pop up ), click on it and the window showed will allow you to enter the 'drop query' without touching any config files( at least i had no problems, hope it will help ).
回答4:
you will need to update file config.default
generally phpmyadmin's libraries folder
line 653 (may very depending on version)
$cfg['AllowUserDropDatabase'] = true;
回答5:
Go to -> your_drive/xampp/PhpMyAdmin/libraries/ (Windows with XAMPP) or /usr/share/phpmyadmin/libraries/ (Linux with PHP/Apache/MySQL/PhpMyAdmin)
Open a file name “config.default.php“
Find $cfg['AllowUserDropDatabase']
You will find the value is “False. Make it to ”True”.
Linux restart apache2 in termina /etc/init.d/apache2 restart (Linux) or XAMPP Control Panel restart Mysql
回答6:
I was able to do without modifying any of the above mentioned files.
Step 1
click on the database icon next to home icon
Step 2
on the right side of the screen select the operations tab
Step 3
Select the drop the database option and it should work[for me it worked even with the tables containing data
回答7:
Drop the database and create a new one. To do so, go to phpmyadmin and select the database over the left panel. Then Go to 'Operations' tab on the head. Find the option to Remove Database at middle right. Click on DROP DATABASE and way to go...
回答8:
PhpMyAdmin throws error “DROP DATABASE” statement is disabled”. “DROP” tab is missing in PhpMyadmin Home page. To Enable above tab in PhpMyAdmin follow below procedure.
Go to XAMPP directory—–>PhpMyAdmin—–>libraries/ folder.
Open/Edit file with name “config.default.php”
Find $cfg['AllowUserDropDatabase']
You will find it’s value is ‘False’, Make it “True” and you’re done.
Refresh PhpMyAdmin Page or Restart MySql server and then open PhpMyAdmin.
回答9:
did you try deleting the database by logging in to mySQL using SSH if you have not already..
sudo mysql -u yourmysqlusername -p (enter the password
when prompted.)
mysql> SHOW DATABASES; (find your database)
mysql> USE YOURDATABSETODROP; (CHANGE THE DATABASE)
mysql> DROP DATABASE YOURDATABSETODROP; (and you are done.)
回答10:
Yes, you can do it with the following steps:
1. Go to wamp/apps/phpmyadmin3.5.1/libraries
2. Open the file called "config.default.php"
3. Go to line 653 and change $cfg['AllowUserDropDatabase'] = false; to true
4.Restart the server to see the changes
Restart the wamp ...Close wamp server and open again. :)
Enjoy!
回答11:
If this happened on a MAC, the chances are you are not running within an administrator's account; you don't have permission to delete the directory.
- In your finder menu bar click "go" and type the following: usr/local/mysql/data
- Select/delete the directory with the same database you want to drop - you will likely get the dialog asking for the admin username and password to continue.
- After you enter the admin credentials, the directory will be gone. Restart your session with the database and you will be good to go.
Hope this helps
回答12:
if you are using version 4+ then you can simply drop a database just following these steps:
- go to mysql admin
- click database option (right side of your databases)
- here you will get all the databases you have and now click the checkbox at the left side of the databases you want to delete
- just the bottom of these databases you can see the option "Drop" so click the drop to delete the database permanently
回答13:
I had to use another icon in CPanel (Databases section / MySqlDatabases) instead of (Databases Section / phpMyAdmin).
(... since my shared web-host provider disables the DROP DATABASE command, and initially limits access to command line and config files.)
回答14:
- select the database in phpadmin
- click the operations button
- show the remove database section
- click the Drop the database(DROP). It show the alert box.
- click OK.
回答15:
I had problems with most of these approaches.
My installation is hosted so I don't have access to the PHP config files and the PHPMyAdmin interface is not displaying the "Remove Database" section mentioned above (under the Operations Tab). The icon in the corner didn't work either.
What I realised you can do is create a stored procedure to delete your table.
Go to "Routines", "Add Routine" and create a stored procedure with the single line:
DROP DATABASE databasename
When that's created you can execute it and the database will get deleted.
回答16:
Go to \wamp\apps\phpmyadmin4.1.14\libraries
Open the file called "config.default.php"
Go to line 653 and change $cfg['AllowUserDropDatabase'] = false; to true
Restart the server to see the changes
回答17:
Go to the left sidebar of phpmyadmin where there is a listing of your databases and select the specific database that you want to delete.
Having done that under the menu bar where there are several options such as query, sql, operations, etc choose structure.
When you do that it will give you a listing of all the tables of the DB and right below the tables there is a checkbox choose check all and on the dropdown after that choose drop.