「MySQL」の版間の差分
提供: sha.ngri.la
細 |
細 |
||
13行目: | 13行目: | ||
mysql> alter table [tablename] modify [データ型]; | mysql> alter table [tablename] modify [データ型]; | ||
</pre> | </pre> | ||
− | == | + | ==text,mediumtext,longtextの容量== |
− | <table border= | + | <table border=1> |
− | + | <tr><th>Data Type</th><th>記憶容量の上限値</th></tr> | |
− | + | <tr><td><code class="nb">BLOB</code>,<code class="nb">TEXT</code></td><td>2<sup>16</sup></td></tr> | |
− | + | <tr><td><code class="nb">MEDIUMBLOB</code>,<code class="nb">MEDIUMTEXT</code></td><td>2<sup>24</sup></td></tr> | |
− | + | <tr><td><code class="nb">LONGBLOB</code>,<code class="nb">LONGTEXT</code></td><td>2<sup>32</sup></td></tr> | |
− | |||
− | <tr> | ||
− | < | ||
− | |||
− | </tr> | ||
− | <tr> | ||
− | <td><code class=" | ||
− | |||
− | |||
− | |||
− | |||
− | <td>2 | ||
− | </ | ||
− | |||
− | |||
− | |||
− | </tr> | ||
− | <tr> | ||
− | <td> | ||
− | <code class=" | ||
− | |||
− | </td> | ||
− | <td> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | </tr> | ||
− | <tr> | ||
− | <td><code class=" | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | </td> | ||
− | <td> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | </tr | ||
− | |||
</table> | </table> |
2014年8月3日 (日) 14:20時点における版
文字化け対策
/etc/my.cnfに次のとおり追加
[client] default-character-set=utf8 [mysqld] default-character-set=utf8 skip-character-set-client-handshake
カラムのデータ型を変更する
mysql> alter table [tablename] modify [データ型];
text,mediumtext,longtextの容量
Data Type | 記憶容量の上限値 |
---|---|
BLOB ,TEXT | 216 |
MEDIUMBLOB ,MEDIUMTEXT | 224 |
LONGBLOB ,LONGTEXT | 232 |