現状設定されている文字コードを調べるコマンドの
show variables like "chara%";
を実行すると以下の結果が返ってきます。
Variable_name | Value
--------------------------+---------------------------------------------------------
character_set_client | cp932
character_set_connection | cp932
character_set_database | utf8
character_set_filesystem | binary
character_set_results | cp932
character_set_server | utf8
character_set_system | utf8
character_sets_dir | C:\Program Files\MySQL\MySQL Server 8.0\share\charsets\
設定ファイルを書き換えることで文字コードを変更できるとあったので
C:\ProgramData\MySQL\MySQL Server 8.0\my.iniに以下を記述しました。
default-character-set=utf8
character-set-server=utf8
その後、Mysqlの再起動を行い、Create文でデータベースを作成。
use 作成したデータベース名を実行し
再度show variables like "chara%"で文字コードを確認したところ
my.ini編集前と同じ結果が返ってきました。
どこが問題か、ご助言頂ければ幸いです。
以下、現状のmy.iniの一部分を記載します。
[client] # pipe= # socket=MYSQL port=3306 [mysql] no-beep default-character-set=utf8 # 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. # # server_type=3 [mysqld] # The next three options are mutually exclusive to SERVER_PORT below. # skip-networking # enable-named-pipe # shared-memory # shared-memory-base-name=MYSQL # The Pipe the MySQL Server will use # socket=MYSQL # 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 8.0/" # Path to the database root datadir=C:/ProgramData/MySQL/MySQL Server 8.0/Data # The default character set that will be used when a new schema or table is # created and no character set is defined character-set-server=utf8
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/07/22 01:46
2019/07/23 05:21
2019/07/23 06:39
2019/07/23 06:57
2019/07/25 04:09