MySql: show databases/tables use database desc table

1. show databases

mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
4 rows in set (0.00 sec)

2. use database_name

mysql> use test
Database changed

3.  show tables

mysql> show tables;
+----------------+
| Tables_in_test |
+----------------+
| user |
+----------------+
1 row in set (0.00 sec)

4. desc table_name

mysql> desc user;
+-------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+-------------+------+-----+---------+-------+
| id | varchar(20) | NO | PRI | NULL | |
| name | varchar(20) | YES | | NULL | |
+-------+-------------+------+-----+---------+-------+
2 rows in set (0.09 sec)

时间: 2024-10-15 00:48:39

MySql: show databases/tables use database desc table的相关文章

oracle中与mysql中的命令 show databases, show tables, desc table类似的命令集

1 怎样执行一个sql脚本文件,这个脚本文件写了一系列的sql语句集,比如sql.sql 放在D:\MyEclipse 8.6\Workspaces\OASystem\WebRoot\sql.sql下 >cd D:\MyEclipse 8.6\Workspaces\OASystem\WebRoot\ >>sqlplus >>@ sql.sql; 2 怎样查看刚刚创建的表 SQL> select table_name from user_tables; SQL Plus

导出Mysql数据库出错:Got error: 145: Table 'wp_options' is marked as crashed and should be repaired when using LOCK TABLES的解决方法

mysqldump: Got error: 145: Table 'wp_options' is marked as crashed and should be repaired when using LOCK TABLES 错误如上所示. 今天在给自己的wp网站搬家的时候,导出数据时发现导不出来,报了如上的错误,在网上找了一下资料,说是这张张被标记有问题,需要优化.参考: http://www.cnblogs.com/hakuci/archive/2012/03/20/2407723.html

MySQL 5.6 Reference Manual-14.6 InnoDB Table Management

14.6 InnoDB Table Management 14.6.1 Creating InnoDB Tables 14.6.2 Moving or Copying InnoDB Tables to Another Machine 14.6.3 Grouping DML Operations with Transactions 14.6.4 Converting Tables from MyISAM to InnoDB 14.6.5 AUTO_INCREMENT Handling in Inn

Mysql –>EF edmx(model first)–> Sql server table

一.mysql environment When we create an new database,first We need draw er diagram for somebody to show your idea,but our company have no good authorised tool to design sqlserver ER diagram,so I use mysql graphical tool to design it, after that,you can

mysql Ignoring query to other database

mysql 碰到了Ignoring query to other database问题: [email protected] ~]# mysql -root -p --socket=/tmp/mysql.sock Enter password:  Welcome to the MySQL monitor.  Commands end with ; or \g. Your MySQL connection id is 5 Server version: 5.6.22-log Source dist

sql--select into,create database,create table,Constraints

SQL SELECT INTO 语句可用于创建表的备份复件.SELECT INTO 语句SELECT INTO 语句从一个表中选取数据,然后把数据插入另一个表中.SELECT INTO 语句常用于创建表的备份复件或者用于对记录进行存档. SQL SELECT INTO 语法 您可以把所有的列插入新表:SELECT *INTO new_table_name [IN externaldatabase] FROM old_tablename或者只把希望的列插入新表:SELECT column_name

Get size of all tables in database

http://stackoverflow.com/questions/7892334/get-size-of-all-tables-in-database SELECT t.NAME AS TableName, s.Name AS SchemaName, p.rows AS RowCounts, SUM(a.total_pages) * 8 AS TotalSpaceKB, SUM(a.used_pages) * 8 AS UsedSpaceKB, (SUM(a.total_pages) - S

Could not update the distribution database subscription table. The subscription status could not be changed.

在一个测试服务器删除发布(Publication)时遇到下面错误,具体如下所示 标题: Microsoft SQL Server Management Studio   ------------------------------   Could not delete publication 'RPL_GES_MIS_QCSDB'.   ------------------------------   其他信息:   An exception occurred while executing a

mysql中You can’t specify target table for update in FROM clause错误解决方法

mysql中You can't specify target table for update in FROM clause错误的意思是说,不能先select出同一表中的某些值,再update这个表(在同一语句中). 例如下面这个sql: 1 delete from tbl where id in 2 ( 3 select max(id) from tbl a where EXISTS 4 ( 5 select 1 from tbl b where a.tac=b.tac group by ta