Translations of this page:
- 日本語 (ja)
- English (en)
最近の更新
Tag Cloud
このページへのアクセス
今日: 1 / 昨日: 3
総計: 545
- DokuWiki(79)
- Dokuwiki.fl8.jp(60)
- 17 WSL2 + Docker(25)
- counter(10)
- サカつく初代(8)
- code2(7)
最近の更新
このページへのアクセス
今日: 1 / 昨日: 3
総計: 545
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)