phpmyadmin启用删除数据库语句
我的托管提供商提醒我,我超出了 1000 桌限制。我有很多数据库,想一次删除更多。不幸的是,他们没有多选功能,所以我决定在 phpmyadmin 中使用查询。
当我尝试诸如 DROP database some_name 之类的操作时,我得到 DROP DATABASE statements aredisables
有谁知道是否可以启用它们或以不同的方式删除多个数据库?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(20)
看起来有一个 phpMyAdmin 设置 您需要在 config.inc.php 中编辑。
It looks like there is a phpMyAdmin setting that you need to edit in config.inc.php.
是的,您可以通过以下步骤完成此操作:
转到 wamp/apps/phpmyadmin3.5.1/libraries
打开名为的文件"config.default.php"
转到第 653 行并将
$cfg['AllowUserDropDatabase'] = false;
更改为 < em>true重新启动服务器以查看更改
对于 Windows XP 用户:如果未反映效果,请通过快速启动图标退出 WAMP 并尝试重新启动。
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
For Windows XP users: if the effect is not reflected, exit WAMP through the quick launch icon and try restarting it.
your_drive/xampp/PhpMyAdmin/libraries/
(带有 XAMPP 的 Windows)或
/usr/share/phpmyadmin/libraries/
(Linux with PHP/Apache/MySQL/PhpMyAdmin)打开文件名
config.default.php
查找
$cfg['AllowUserDropDatabase']
你会发现该值为
False
。将其更改为True
。Linux 在终端中重新启动 apache2
/etc/init.d/apache2 restart
(Linux) 或XAMPP 控制面板重新启动 Mysql
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
. Change it toTrue
.Linux restart apache2 in terminal
/etc/init.d/apache2 restart
(Linux) orXAMPP Control Panel restart Mysql
方法一:XAMPP窗口
$cfg['AllowUserDropDatabase'] = true;
方法二:在 config.inc.php 中添加一行
$cfg['AllowUserDropDatabase'] =正确;
Method 1: XAMPP window
$cfg['AllowUserDropDatabase'] = true;
Method 2: Adding line in config.inc.php
$cfg['AllowUserDropDatabase'] = true;
无需触摸任何配置文件
如果您打开了 phpmyadmin,在左侧,您将在主页图标旁边看到一个数据库图标(如果您将鼠标悬停在它上面 - 将弹出“查询窗口”标题) ),单击它,显示的窗口将允许您输入“删除查询”,而无需触摸任何配置文件(至少我没有问题,希望它会有所帮助)。
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 ).
您需要更新文件
config.default
,通常是phpmyadmin的库文件夹第653行(可能非常取决于版本)
$cfg['AllowUserDropDatabase'] = true;
you will need to update file
config.default
generally phpmyadmin's libraries folderline 653 (may very depending on version)
$cfg['AllowUserDropDatabase'] = true;
PhpMyAdmin 抛出错误“DROP DATABASE”语句已禁用”。 PhpMyadmin 主页上缺少“DROP”选项卡。要在 PhpMyAdmin 中启用上述选项卡,请按照以下步骤操作。
进入XAMPP目录——>PhpMyAdmin——>libraries/文件夹。
打开/编辑名为“config.default.php”的文件
查找$cfg['AllowUserDropDatabase']
你会发现它的值为'False',将其设置为“True”即可。
刷新 PhpMyAdmin 页面或重新启动 MySql 服务器,然后打开 PhpMyAdmin。
PhpMyAdmin throws the error “DROP DATABASE” statement is disabled”. “DROP” tab is missing on the PhpMyadmin Home page. To Enable the above tab in PhpMyAdmin follows the below procedure.
Go to XAMPP directory—–>PhpMyAdmin—–>libraries/ folder.
Open/Edit the file with the 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.
我无需修改任何上述文件即可完成。
步骤 1
单击主页图标旁边的数据库图标
步骤 2
在屏幕右侧选择操作选项卡
步骤 3
选择删除数据库选项,它应该可以工作[对我来说,即使包含数据的表也可以工作
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
删除数据库并创建一个新数据库。为此,请转到 phpmyadmin 并在左侧面板上选择数据库。然后转到头部的“操作”选项卡。在右中找到“删除数据库”选项。单击“删除数据库”,然后继续...
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...
您是否尝试通过使用 SSH 登录 mySQL 来删除数据库(如果您还没有尝试过)
did you try deleting the database by logging in to mySQL using SSH if you have not already..
有时 PhpMyAdmin 会抛出非常不寻常的错误:““DROP DATABASE”语句已禁用”。
在这种情况下,PhpMyAdmin 主页中看不到“DROP” 选项卡。您可以通过执行以下过程来解决此问题。
将其转换为: $cfg['AllowUserDropDatabase'] = true;
:) 你现在可以删除数据库。
Sometimes PhpMyAdmin throws very unusual error: ““DROP DATABASE” statement is disabled”.
In this situation the “DROP” tab can not be seen in PhpMyAdmin home page. You can get rid of this problem by doing the following process.
convert it to like: $cfg['AllowUserDropDatabase'] = true;
:) you can now able to drop the database.
重新启动wamp...关闭wamp服务器并再次打开。 :)享受!
Restart the wamp...Close wamp server and open again. :)Enjoy!
如果这种情况发生在 MAC 上,则很可能您没有在管理员帐户中运行;您无权删除该目录。
希望这有帮助
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.
Hope this helps
如果您使用的是版本 4+,那么您只需按照以下步骤删除数据库即可:
if you are using version 4+ then you can simply drop a database just following these steps:
我必须在 CPanel(数据库部分/MySqlDatabases)中使用另一个图标,而不是(数据库部分/phpMyAdmin)。
(...因为我的共享网络主机提供商禁用了 DROP DATABASE 命令,并且最初限制了对命令行和配置文件的访问。)
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.)
我对这些方法中的大多数都遇到了问题。
我的安装是托管的,因此我无权访问 PHP 配置文件,并且 PHPMyAdmin 界面未显示上面提到的“删除数据库”部分(在“操作”选项卡下)。角落里的图标也不起作用。
我意识到你可以做的是创建一个存储过程来删除你的表。
转到“例程”、“添加例程”并使用单行创建一个存储过程:
DROP DATABASE databasename
创建后,您可以执行它,数据库将被删除。
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.
转到 \wamp\apps\phpmyadmin4.1.14\libraries
打开名为“config.default.php”的文件
转到第 653 行并更改 $cfg['AllowUserDropDatabase'] = false;为真
重新启动服务器即可看到变化
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
当我尝试删除数据库时,我注意到同样的问题(5.0.2 是我正在使用的 PhpMyAdmin 版本)。就我而言,
config.inc.php
文件和默认配置文件libraries/config.default 中没有
默认情况下$cfg['AllowUserDropDatabase']
变量.phpfalse
。如果您想允许暂时删除数据库,我建议您在
config.inc.php
$cfg['AllowUserDropDatabase'] = true; 行> 文件(或者将false
值更改为true
,如果它已经存在),而不是修改libraries/config.default.php
中的默认值> 这里推荐一些答案,因为正如文档所述, "该文件不适合更改"。完成您的操作后,只需完全删除该行或再次将其设置回false
即可。I noticed the same problem when I was trying to drop a database (5.0.2 is the version of PhpMyAdmin I am using). In my case, there is no
$cfg['AllowUserDropDatabase']
variable in theconfig.inc.php
file and the default config filelibraries/config.default.php
has itfalse
by default.If you want to allow dropping a database temporarily, I would recommend just adding a
$cfg['AllowUserDropDatabase'] = true;
line in the end of theconfig.inc.php
file (or change thefalse
value totrue
instead if it's already there) instead of modifying the default value inlibraries/config.default.php
that some answers here recommend because as the documentation says, "the file is not intended for changes". After doing your thing, just delete the line altogether or set it back tofalse
again.转到 phpmyadmin 的左侧边栏,其中列出了您的数据库,然后选择您要删除的特定数据库。
完成后,在菜单栏下有几个选项,例如查询、sql、操作等,选择结构 >.
当您执行此操作时,它将为您提供数据库所有表的列表,并且在表的正下方有一个复选框,选择检查全部,然后在该选择后面的下拉列表中选择删除。
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.