データベースを作成する †mysql> CREATE DATABASE データベース名 データベースを表示する †[root@www ~]# mysqlshow -uroot -p Enter password: +--------------------+ | Databases | +--------------------+ | information_schema | | mysql | | test | | webdb1 | +--------------------+ MySQLのプロンプト内で mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | | test | | webdb1 | +--------------------+ 5 rows in set (0.00 sec) -> とすることもできます。 データベース情報を表示する †[root@www ~]# mysqlshow webdb1 -p -uroot Enter password: Database: webdb1 +--------+ | Tables | +--------+ | rss | +--------+ MySQLのプロンプト内で、 mysql> use webdb1; Database changed mysql> show tables; +------------------+ | Tables_in_webdb1 | +------------------+ | rss | +------------------+ 1 row in set (0.00 sec) とすることもできます。 テーブル情報を表示する †[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) 参考: この記事は 現在のアクセス:10849 |