mysql> CREATE DATABASE データベース名
[root@www ~]# mysqlshow -uroot -p Enter password: +--------------------+ | Databases | +--------------------+ | information_schema | | mysql | | test | | webdb1 | +--------------------+
[root@www ~]# mysqlshow webdb1 -p -uroot Enter password: Database: webdb1 +--------+ | Tables | +--------+ | rss | +--------+
[root@www ~]# mysql webdb1 -p -uroot Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 53 to server version: 5.0.15-max-log Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> describe rss; +-------+------------------+------+-----+---------------------+----------------+ | Field | Type | Null | Key | Default | Extra | +-------+------------------+------+-----+---------------------+----------------+ | id | int(10) unsigned | NO | PRI | NULL | auto_increment | | title | varchar(255) | YES | | | | | link | text | YES | | NULL | | | date | datetime | NO | | 0000-00-00 00:00:00 | | +-------+------------------+------+-----+---------------------+----------------+ 4 rows in set (0.00 sec) mysql>
テーブルがどの様なSQL文で作成されたか表示します。
mysql> show create table webdb1.rss; --------------------------+ | Table | Create Table --------------------------+ | rss | CREATE TABLE `rss` ( `id` int(10) unsigned NOT NULL auto_increment, `title` varchar(255) default '', `link` text, `date` datetime NOT NULL default '0000-00-00 00:00:00', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=ujis COMMENT='RSS List' | +-------+--------------------------------------------------- 1 row in set (0.00 sec)
参考:
http://www.rfs.jp/sitebuilder/sql/04/07.html#SHOW%20CREATE%20TABLE
この記事は
現在のアクセス:10650