MySQL phpmyadmin 启用删除数据库语句
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4410630/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
phpmyadmin enable drop database statement
提问by vii
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.
我的托管服务提供商提醒我我超过了 1000 个表的限制。我有很多数据库,想一次删除更多。不幸的是,他们没有多选功能,所以我决定在 phpmyadmin 中使用查询。
When I try something like DROP database some_name
I get DROP DATABASE statements are disables
当我尝试像DROP database some_name
我得到DROP DATABASE statements are disables
Does anyone know if it's possible to enable them or a different way to delete multiple databases?
有谁知道是否可以启用它们或以不同的方式删除多个数据库?
回答by Pekka
It looks like there is a phpMyAdmin settingthat you need to edit in config.inc.php.
看起来您需要在 config.inc.php 中编辑一个phpMyAdmin 设置。
boolean $cfg['AllowUserDropDatabase'] (line 503)
show a 'Drop database' link to normal users
布尔值 $cfg['AllowUserDropDatabase'](第 503 行)
向普通用户显示“删除数据库”链接
回答by vii
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 trueRestart the server to see the changes
转到 wamp/apps/phpmyadmin3.5.1/libraries
打开名为“config.default.php”的文件
转到第 653 行并更改
$cfg['AllowUserDropDatabase'] = false;
为true重新启动服务器以查看更改
For Windows XP users: if the effect is not reflected, exit WAMP through the quick launch icon and try restarting it.
对于 Windows XP 用户:如果没有体现效果,请通过快速启动图标退出 WAMP 并尝试重新启动它。
回答by orustammanapov
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 ).
如果您打开了 phpmyadmin,在左侧,您会在主页图标旁边看到一个数据库图标(如果您将鼠标悬停在它上面 - '查询窗口' 标题将弹出),点击它,显示的窗口将允许您可以在不接触任何配置文件的情况下输入“删除查询”(至少我没有问题,希望它会有所帮助)。
回答by Vasek
you will need to update file config.default
generally phpmyadmin's libraries folder
您通常需要更新文件config.default
phpmyadmin 的库文件夹
line 653 (may very depending on version)
第 653 行(可能非常取决于版本)
$cfg['AllowUserDropDatabase'] = true;
$cfg['AllowUserDropDatabase'] = true;
回答by Matija
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
转到 -> your_drive/xampp/PhpMyAdmin/libraries/(带有 XAMPP 的 Windows)或 /usr/share/phpmyadmin/libraries/(带有 PHP/Apache/MySQL/PhpMyAdmin 的 Linux)
打开一个名为“config.default.php”的文件
找到 $cfg['AllowUserDropDatabase']
您会发现该值为“False”。使其成为“真实”。
Linux 在终端 /etc/init.d/apache2 restart (Linux) 或 XAMPP 控制面板中重启 apache2 重启 Mysql
回答by Yash Vekaria
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.
PhpMyAdmin 抛出错误“DROP DATABASE”语句被禁用”。PhpMyadmin 主页中缺少“DROP”选项卡。要在 PhpMyAdmin 中启用上述选项卡,请按照以下步骤操作。
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.
进入XAMPP目录-->PhpMyAdmin-->libraries/文件夹。
打开/编辑名为“config.default.php”的文件
找到 $cfg['AllowUserDropDatabase']
你会发现它的值是“假”,把它设为“真”,你就完成了。
刷新 PhpMyAdmin 页面或重新启动 MySql 服务器,然后打开 PhpMyAdmin。
回答by Mightian
I was able to do without modifying any of the above mentioned files.
我能够在不修改上述任何文件的情况下进行操作。
Step 1
第1步
click on the database icon next to home icon
单击主页图标旁边的数据库图标
Step 2
第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
步骤 3 选择删除数据库选项,它应该可以工作[对我来说它甚至可以与包含数据的表一起使用
回答by Raa Vijay
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...
删除数据库并创建一个新数据库。为此,请转到 phpmyadmin 并在左侧面板上选择数据库。然后转到头部的“操作”选项卡。在右侧中间找到删除数据库的选项。单击 DROP DATABASE 和方式去...
回答by Ashish Madkaikar
did you try deleting the database by logging in to mySQL using SSH if you have not already..
如果您还没有,您是否尝试通过使用 SSH 登录到 mySQL 来删除数据库..
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.)
sudo mysql -u yourmysqlusername -p(出现提示时输入密码。)
mysql> 显示数据库;(找到你的数据库)
mysql> 使用你的数据库设置删除;(更改数据库)
mysql> DROP DATABASE YOURDATABSETODROP; (你已经完成了。)
回答by CAtoOH
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.
如果这发生在 MAC 上,很可能您不是在管理员帐户中运行;您无权删除该目录。
- 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.
- 在您的 finder 菜单栏中单击“go”并键入以下内容:usr/local/mysql/data
- 选择/删除与您要删除的数据库相同的目录 - 您可能会看到要求管理员用户名和密码继续的对话框。
- 输入管理员凭据后,该目录将消失。重新启动与数据库的会话,您就可以开始了。
Hope this helps
希望这可以帮助