Test
Unlock the main MySQL first
> unlock tables;
Delete a table
> Use db1; > show tables; > drop table help_category;
Go and see it from MySQL.
> Use db1; > Show tables;
No help_category.
////////////////////////////////////////////////////////////////////////
Create a table
Show create table user;
> CREATE TABLE ' Wangshaojun '
(
' Host ' char COLLATE utf8_bin not NULL DEFAULT ' ',
' User ' char (+) COLLATE utf8_bin not NULL DEFAULT ' ',
' Password ' char (CHARACTER SET latin1 COLLATE latin1_bin not NULL DEFAULT ' ',
' Select_priv ' enum (' n ', ' Y ') CHARACTER SET UTF8 not NULL DEFAULT ' N ',
' Insert_priv ' enum (' n ', ' Y ') CHARACTER SET UTF8 not NULL DEFAULT ' N ',
' Update_priv ' enum (' n ', ' Y ') CHARACTER SET UTF8 not NULL DEFAULT ' N ',
' Delete_priv ' enum (' n ', ' Y ') CHARACTER SET UTF8 not NULL DEFAULT ' N ',
' Create_priv ' enum (' n ', ' Y ') CHARACTER SET UTF8 not NULL DEFAULT ' N ',
' Drop_priv ' enum (' n ', ' Y ') CHARACTER SET UTF8 not NULL DEFAULT ' N ',
' Reload_priv ' enum (' n ', ' Y ') CHARACTER SET UTF8 not NULL DEFAULT ' N ',
' Shutdown_priv ' enum (' n ', ' Y ') CHARACTER SET UTF8 not NULL DEFAULT ' N ',
' Process_priv ' enum (' n ', ' Y ') CHARACTER SET UTF8 not NULL DEFAULT ' N ',
' File_priv ' enum (' n ', ' Y ') CHARACTER SET UTF8 not NULL DEFAULT ' N ',
' Grant_priv ' enum (' n ', ' Y ') CHARACTER SET UTF8 not NULL DEFAULT ' N ',
' References_priv ' enum (' n ', ' Y ') CHARACTER SET UTF8 not NULL DEFAULT ' N ',
' Index_priv ' enum (' n ', ' Y ') CHARACTER SET UTF8 not NULL DEFAULT ' N ',
' Alter_priv ' enum (' n ', ' Y ') CHARACTER SET UTF8 not NULL DEFAULT ' N ',
' Show_db_priv ' enum (' n ', ' Y ') CHARACTER SET UTF8 not NULL DEFAULT ' N ',
' Super_priv ' enum (' n ', ' Y ') CHARACTER SET UTF8 not NULL DEFAULT ' N ',
' Create_tmp_table_priv ' enum (' n ', ' Y ') CHARACTER SET UTF8 not NULL DEFAULT ' N ',
' Lock_tables_priv ' enum (' n ', ' Y ') CHARACTER SET UTF8 not NULL DEFAULT ' N ',
' Execute_priv ' enum (' n ', ' Y ') CHARACTER SET UTF8 not NULL DEFAULT ' N ',
' Repl_slave_priv ' enum (' n ', ' Y ') CHARACTER SET UTF8 not NULL DEFAULT ' N ',
' Repl_client_priv ' enum (' n ', ' Y ') CHARACTER SET UTF8 not NULL DEFAULT ' N ',
' Create_view_priv ' enum (' n ', ' Y ') CHARACTER SET UTF8 not NULL DEFAULT ' N ',
' Show_view_priv ' enum (' n ', ' Y ') CHARACTER SET UTF8 not NULL DEFAULT ' N ',
' Create_routine_priv ' enum (' n ', ' Y ') CHARACTER SET UTF8 not NULL DEFAULT ' N ',
' Alter_routine_priv ' enum (' n ', ' Y ') CHARACTER SET UTF8 not NULL DEFAULT ' N ',
' Create_user_priv ' enum (' n ', ' Y ') CHARACTER SET UTF8 not NULL DEFAULT ' N ',
' Event_priv ' enum (' n ', ' Y ') CHARACTER SET UTF8 not NULL DEFAULT ' N ',
' Trigger_priv ' enum (' n ', ' Y ') CHARACTER SET UTF8 not NULL DEFAULT ' N ',
' Ssl_type ' enum (' ', ' any ', ' X509 ', ' SPECIFIED ') CHARACTER SET UTF8 not NULL DEFAULT ' ',
' Ssl_cipher ' blob not NULL,
' X509_issuer ' blob not NULL,
' X509_subject ' blob not NULL,
' Max_questions ' int (one) unsigned not NULL DEFAULT ' 0 ',
' Max_updates ' int (one) unsigned not NULL DEFAULT ' 0 ',
' Max_connections ' int (one) unsigned not NULL DEFAULT ' 0 ',
' Max_user_connections ' int (one) unsigned not NULL DEFAULT ' 0 ',
PRIMARY KEY (' Host ', ' User ')
) Engine=myisam DEFAULT Charset=utf8 collate=utf8_bin comment= ' Users and global privileges ';
This string is the copy of the above command inside,
View List
> Show tables;
One more Wangshaojun table.
In the view from MySQL, as many as a table: Wangshaojun
//////////////////////////////////////////////////////////////////////////////////////
The main delete db1 library, view the library, no db1.
> drop database db1; > show databases;
From view db1 the table below, error. View library, no db1.
> show tables; > show databases;
Deploying and Tuning 2.9 MySQL master-slave configuration-3