mysql:12420
From: TOMTOM <TOMTOM <tomf1@xxxxxxxxxx>>
Date: Thu, 10 Nov 2005 11:44:50 +0900
Subject: [mysql 12420] 日本語が使えません。
はじめまして、TOMTOMと申します。
MySQLを、利用し始めたばかりの者です。
教えて欲しいことがあり、発言しました。
環境は WIN XP
MySQL 5.0
を利用しています。
ちょっと調べて、日本語を使えるように、
以下のように、my.iniファイルの一部を内容を変えました。
*************************************************
[client]
port=3306
[mysql]
default-character-set=sjis
# sjisに変更
# SERVER SECTION
# ----------------------------------------------------------------------
#
# The following options will be read by the MySQL Server. Make sure that
# you have installed the server correctly (see above) so it reads this
# file.
#
[mysqld]
# The TCP/IP Port the MySQL Server will listen on
port=3306
#Path to installation directory. All paths are usually resolved relative to this.
basedir="C:/Program Files/MySQL/MySQL Server 5.0/"
#Path to the database root
datadir="C:/Program Files/MySQL/MySQL Server 5.0/Data/"
# The default character set that will be used when a new schema or table is
# created and no character set is defined
default-character-set=sjis
#sjisに変更
*************************************************
上記のように、、二箇所のdefault-character-setをsjisに変更しました。
その後、
DOSプロンプトで、
mysql を実行、
以下の、コマンドを、実行しました。
use test;
create table ff (name varchar(50));
insert into ff (name) values ('1234567890123456789');
ここまでは、問題なく実行されるのですが、
以下のような、日本語を実行させると、
mysql> insert into ff (name) values ('こんんち');
ERROR 1406 (22001): Data too long for column 'name' at row 1
以上のような結果になりって、日本語が使えません。
日本語を、使うにあったて、
my.iniの二箇所を変更しただけで、駄目なのでしょうか。??
それとも、別の問題なんでしょうか。
初心者なので、良く分かりません。
よろしくお願いいたします。
-> 12420 2005-11-10 11:44 [TOMTOM <tomf1@xxxxxx] 日本語が使えません。 12422 2005-11-10 12:53 ┣[KAJIYAMA Ryusuke <r-] 12423 2005-11-10 12:56 ┣[高橋政利 <takahashi@] 12431 2005-11-10 18:58 ┗[Hiroshi Moriyama <mt] 12438 2005-11-12 08:53 ┗[TOMTOM <tomf1@xxxxxx]