Translations of this page:
- 日本語 (ja)
- English (en)
最近の更新
Tag Cloud
このページへのアクセス
今日: 5 / 昨日: 1
総計: 373
- Dokuwiki.fl8.jp(249)
- 13 CentOS6メール設定(14)
- 34 UnboundでHA構成(12)
- 05 rsync(12)
- 02 ProFTPD(12)
最近の更新
このページへのアクセス
今日: 5 / 昨日: 1
総計: 373
The BIT field values are not displayed in MySQL.
It's because BIT values are characters that cannot be printed…
To see them, add UNSIGNED.
※ Specifying UNSIGNED allows only positive numbers to be stored.
mysql> desc test;
+---------+---------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+---------+---------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| name | text | YES | | NULL | |
| enabled | bit(1) | YES | | NULL | |
+---------+---------+------+-----+---------+----------------+
3 rows in set (0.00 sec)
mysql> insert into test (name,enabled) VALUES('AAA',b'1');
Query OK, 1 row affected (0.01 sec)
mysql> insert into test (name,enabled) VALUES('BBB',b'0');
Query OK, 1 row affected (0.00 sec)
mysql> select * from test;
+----+------+---------+
| id | name | enabled |
+----+------+---------+
| 1 | AAA | |
| 2 | BBB | |
+----+------+---------+
2 rows in set (0.00 sec)