mysql删掉数据库失败_如何删除MySQL数据库?
发布时间:2022-11-25 12:43:41 所属栏目:MySql教程 来源:
导读: mysql删掉数据库失败
MySQL is a very popular opensource database it is used by a lot of different types and size companies. In this post, we will look at how to drop or delete MySQL databas
MySQL is a very popular opensource database it is used by a lot of different types and size companies. In this post, we will look at how to drop or delete MySQL databas
mysql删掉数据库失败 MySQL is a very popular opensource database it is used by a lot of different types and size companies. In this post, we will look at how to drop or delete MySQL databases? MySQL是一种非常流行的开源数据库,许多类型和规模的公司都在使用它。 在本文中MySQL 删除数据库,我们将研究如何删除或删除MySQL数据库? 登录MySQL数据库 (Login MySQL Database) Dropping/Deleting/Removing a database in MySQL server is a simple and fast solution that will delete data as well as table and database schemes. We will command to the local MySQL server daemon whit root privileges. 在MySQL服务器中删除/删除/删除数据库是一种简单而快速的解决方案,它将删除数据以及表和数据库方案。 我们将命令root特权到本地MySQL服务器守护进程。 $ sudo mysql -u root Login MySQL Database Login MySQL Database 登录MySQL数据库 列出数据库(List Databases) We will list existing databases to get the database names and do not make a mistake. 我们将列出现有数据库以获取数据库名称,并且不会出错。 show databases; List Databases List Databases 列出数据库 删除数据库(Drop Database) We will drop the database names test. The syntax of the drop is simple like below. We issue command DROP DATABASE and provide database name as in this example test. 我们将删除数据库名称测试。 删除的语法很简单,如下所示。 我们发出命令DROP DATABASE并提供数据库名称,如本示例测试中所示。 DROP DATABASE test; Drop Database 删除数据库 删除数据库中的所有表(Drop All Tables In A Database) Another alternative is dropping all tables one by one or with a simple script. Here database will be not removed but the tables of the database will be deleted. 另一种选择是一个表或一个简单脚本删除所有表。 这里不会删除数据库,但会删除数据库表。 SET FOREIGN_KEY_CHECKS = 0; MySQL 删除数据库_mysql删除一条最后数据_删除mysql表中数据 SET @tables = NULL; SELECT GROUP_CONCAT(table_schema, '.', table_name) INTO @tables FROM information_schema.tables WHERE table_schema = 'database_name'; -- specify DB name here. SET @tables = CONCAT('DROP TABLE ', @tables); PREPARE stmt FROM @tables; EXECUTE stmt; DEALLOCATE PREPARE stmt; SET FOREIGN_KEY_CHECKS = 1; (编辑:开发网_商丘站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
站长推荐