phpmyadmin启用删除数据库语句

发布于 2024-10-07 04:50:48 字数 209 浏览 0 评论 0原文

我的托管提供商提醒我,我超出了 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(20

倒数 2024-10-14 04:50:48

看起来有一个 phpMyAdmin 设置 您需要在 config.inc.php 中编辑。

布尔$cfg['AllowUserDropDatabase'](第503行)

向普通用户显示“删除数据库”链接

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

饮湿 2024-10-14 04:50:48

是的,您可以通过以下步骤完成此操作:

  1. 转到 wamp/apps/phpmyadmin3.5.1/libraries

  2. 打开名为的文件"config.default.php"

  3. 转到第 653 行并将 $cfg['AllowUserDropDatabase'] = false; 更改为 < em>true

  4. 重新启动服务器以查看更改

对于 Windows XP 用户:如果未反映效果,请通过快速启动图标退出 WAMP 并尝试重新启动。

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

For Windows XP users: if the effect is not reflected, exit WAMP through the quick launch icon and try restarting it.

潦草背影 2024-10-14 04:50:48
  1. 前往-> your_drive/xampp/PhpMyAdmin/libraries/ (带有 XAMPP 的 Windows)

/usr/share/phpmyadmin/libraries/ (Linux with PHP/Apache/MySQL/PhpMyAdmin)

  1. 打开文件名config.default.php

  2. 查找$cfg['AllowUserDropDatabase']

  3. 你会发现该值为False。将其更改为True

  4. Linux 在终端中重新启动 apache2 /etc/init.d/apache2 restart (Linux) 或 XAMPP 控制面板重新启动 Mysql

  1. Go to -> your_drive/xampp/PhpMyAdmin/libraries/ (Windows with XAMPP)

or

/usr/share/phpmyadmin/libraries/ (Linux with PHP/Apache/MySQL/PhpMyAdmin)

  1. Open a file name config.default.php

  2. Find $cfg['AllowUserDropDatabase']

  3. You will find the value is False. Change it to True.

  4. Linux restart apache2 in terminal /etc/init.d/apache2 restart (Linux) or XAMPP Control Panel restart Mysql

独孤求败 2024-10-14 04:50:48

方法一:XAMPP窗口

Xampp window

  1. 打开Xampp
  2. apache ->配置-> phpMyAdmin(config.inc.php) 或 config.inc.php
  3. 添加 $cfg['AllowUserDropDatabase'] = true;

方法二:在 config.inc.php 中添加一行

在 config.inc.php 中添加行

  1. 打开 C:\xampp\phpMyAdmin\config.inc.php
  2. 添加 $cfg['AllowUserDropDatabase'] =正确;

Method 1: XAMPP window

Xampp window

  1. Open Xampp
  2. apache -> Config -> phpMyAdmin(config.inc.php) or config.inc.php
  3. Add $cfg['AllowUserDropDatabase'] = true;

Method 2: Adding line in config.inc.php

Adding line in config.inc.php

  1. Open C:\xampp\phpMyAdmin\config.inc.php
  2. Add $cfg['AllowUserDropDatabase'] = true;
过气美图社 2024-10-14 04:50:48

无需触摸任何配置文件

如果您打开了 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 ).

Database button

猛虎独行 2024-10-14 04:50:48

您需要更新文件config.default,通常是phpmyadmin的库文件夹

第653行(可能非常取决于版本)

$cfg['AllowUserDropDatabase'] = true;

you will need to update file config.default generally phpmyadmin's libraries folder

line 653 (may very depending on version)

$cfg['AllowUserDropDatabase'] = true;

谈下烟灰 2024-10-14 04:50:48

PhpMyAdmin 抛出错误“DROP DATABASE”语句已禁用”。 PhpMyadmin 主页上缺少“DROP”选项卡。要在 PhpMyAdmin 中启用上述选项卡,请按照以下步骤操作。

  1. 进入XAMPP目录——>PhpMyAdmin——>libraries/文件夹。

  2. 打开/编辑名为“config.default.php”的文件

  3. 查找$cfg['AllowUserDropDatabase']

  4. 你会发现它的值为'False',将其设置为“True”即可。

  5. 刷新 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.

  1. Go to XAMPP directory—–>PhpMyAdmin—–>libraries/ folder.

  2. Open/Edit the file with the name “config.default.php”

  3. Find $cfg['AllowUserDropDatabase']

  4. You will find it’s value is ‘False’, Make it “True” and you’re done.

  5. Refresh PhpMyAdmin Page or Restart MySql server and then open PhpMyAdmin.

千柳 2024-10-14 04:50:48

我无需修改任何上述文件即可完成

步骤 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
click on the database icon next to home icon

Step 2

on the right side of the screen select the operations tab
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
Select the drop the database option and you are done

动次打次papapa 2024-10-14 04:50:48

删除数据库并创建一个新数据库。为此,请转到 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...

枫林﹌晚霞¤ 2024-10-14 04:50:48

您是否尝试通过使用 SSH 登录 mySQL 来删除数据库(如果您还没有尝试过)

sudo mysql -u yourmysql用户名 -p (输入密码
当出现提示时。)

mysql>显示数据库; (找到您的数据库)

mysql>使用您的数据库删除; (更改数据库)

mysql>删除数据库 YOURDATABSETROP; (你就完成了。)

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.)

三生殊途 2024-10-14 04:50:48

输入图片此处描述

有时 PhpMyAdmin 会抛出非常不寻常的错误:““DROP DATABASE”语句已禁用”

在这种情况下,PhpMyAdmin 主页中看不到“DROP” 选项卡。您可以通过执行以下过程来解决此问题。

  1. 前往-> your_drive/xampp/PhpMyAdmin/libraries/
  2. 打开文件名“config.default.php”
  3. 查找 $cfg['AllowUserDropDatabase'] = false;
    将其转换为: $cfg['AllowUserDropDatabase'] = true;
  4. 停止 mysql 服务器并重新启动。

:) 你现在可以删除数据库。

enter image description here

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.

  1. Go to -> your_drive/xampp/PhpMyAdmin/libraries/
  2. Open a file name “config.default.php“
  3. Find $cfg['AllowUserDropDatabase'] = false; and
    convert it to like: $cfg['AllowUserDropDatabase'] = true;
  4. Stop mysql server and Start again.

:) you can now able to drop the database.

扭转时空 2024-10-14 04:50:48

是的,您可以按照以下步骤操作:
1.进入wamp/apps/phpmyadmin3.5.1/libraries
2. 打开名为“config.default.php”的文件
3. 转到第 653 行并更改 $cfg['AllowUserDropDatabase'] = false;为真
4.重新启动服务器以查看更改

重新启动wamp ...关闭wamp服务器并再次打开。 :)

享受!

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!

韬韬不绝 2024-10-14 04:50:48

如果这种情况发生在 MAC 上,则很可能您没有在管理员帐户中运行;您无权删除该目录。

  1. 在您的查找器菜单栏中单击“转到”并输入以下内容: usr/local/mysql/data
  2. 选择/删除与您要删除的数据库相同的目录 - 您可能会收到询问的对话框管理员用户名和密码以继续。
  3. 输入管理员凭据后,该目录将消失。重新启动与数据库的会话,您就可以开始了。

希望这有帮助

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.

  1. In your finder menu bar click "go" and type the following: usr/local/mysql/data
  2. 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.
  3. 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

影子是时光的心 2024-10-14 04:50:48

如果您使用的是版本 4+,那么您只需按照以下步骤删除数据库即可:

  1. 转到 mysql 管理
  2. ,单击数据库选项(数据库的右侧),
  3. 在这里您将获得您拥有的所有数据库,现在单击左侧的复选框在要删除的数据库的一侧,
  4. 在这些数据库的底部,您可以看到“删除”选项,因此单击删除即可永久删除数据库

if you are using version 4+ then you can simply drop a database just following these steps:

  1. go to mysql admin
  2. click database option (right side of your databases)
  3. 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
  4. just the bottom of these databases you can see the option "Drop" so click the drop to delete the database permanently
何以畏孤独 2024-10-14 04:50:48

我必须在 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.)

春花秋月 2024-10-14 04:50:48
  1. 在 phpadmin 中选择数据库,
  2. 单击操作按钮
  3. ,显示删除数据库部分,
  4. 单击删除数据库 (DROP)。它显示警报框。
  5. 单击“确定”。
  1. select the database in phpadmin
  2. click the operations button
  3. show the remove database section
  4. click the Drop the database(DROP). It show the alert box.
  5. click OK.
看透却不说透 2024-10-14 04:50:48

我对这些方法中的大多数都遇到了问题。

我的安装是托管的,因此我无权访问 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.

戏蝶舞 2024-10-14 04:50:48

转到 \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

反话 2024-10-14 04:50:48

当我尝试删除数据库时,我注意到同样的问题(5.0.2 是我正在使用的 PhpMyAdmin 版本)。就我而言,config.inc.php 文件和默认配置文件 libraries/config.default 中没有 $cfg['AllowUserDropDatabase'] 变量.php 默认情况下 false

如果您想允许暂时删除数据库,我建议您在 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 the config.inc.php file and the default config file libraries/config.default.php has it false 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 the config.inc.php file (or change the false value to true instead if it's already there) instead of modifying the default value in libraries/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 to false again.

千纸鹤带着心事 2024-10-14 04:50:48

转到 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文