teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

2

my.cnf、show variables like 'char%';の結果の件

2015/07/28 06:08

投稿

mysqlldutf8
mysqlldutf8

スコア10

title CHANGED
File without changes
body CHANGED
@@ -22,4 +22,185 @@
22
22
  参照:http://www.dbonline.jp/mysql/myini/index3.html
23
23
 
24
24
  my.cnfを初期状態に戻し、my.cnfにサイトに書いてあることの通りの記述をしました。
25
- 参照:http://514design.jp/2013/01/mysql-character-set/
25
+ 参照:http://514design.jp/2013/01/mysql-character-set/
26
+
27
+ -my.cnfの内容
28
+ # Example MySQL config file for medium systems.
29
+ #
30
+ # This is for a system with little memory (32M - 64M) where MySQL plays
31
+ # an important part, or systems up to 128M where MySQL is used together with
32
+ # other programs (such as a web server)
33
+ #
34
+ # You can copy this file to
35
+ # /etc/my.cnf to set global options,
36
+ # mysql-data-dir/my.cnf to set server-specific options (in this
37
+ # installation this directory is /Applications/XAMPP/xamppfiles/var/mysql) or
38
+ # ~/.my.cnf to set user-specific options.
39
+ #
40
+ # In this file, you can use all long options that a program supports.
41
+ # If you want to know which options a program supports, run the program
42
+ # with the "--help" option.
43
+
44
+ # The following options will be passed to all MySQL clients
45
+ [client]
46
+ #password = your_password
47
+ port = 3306
48
+ socket = /Applications/XAMPP/xamppfiles/var/mysql/mysql.sock
49
+ default-character-set=utf8
50
+
51
+ # Here follows entries for some specific programs
52
+
53
+ # The MySQL server
54
+ [mysqld]
55
+ character-set-server=utf8
56
+ user = mysql
57
+ port=3306
58
+ socket = /Applications/XAMPP/xamppfiles/var/mysql/mysql.sock
59
+ skip-external-locking
60
+ key_buffer = 16M
61
+ max_allowed_packet = 1M
62
+ table_open_cache = 64
63
+ sort_buffer_size = 512K
64
+ net_buffer_length = 8K
65
+ read_buffer_size = 256K
66
+ read_rnd_buffer_size = 512K
67
+ myisam_sort_buffer_size = 8M
68
+
69
+ # Where do all the plugins live
70
+ plugin_dir = /Applications/XAMPP/xamppfiles/lib/mysql/plugin/
71
+
72
+ # Don't listen on a TCP/IP port at all. This can be a security enhancement,
73
+ # if all processes that need to connect to mysqld run on the same host.
74
+ # All interaction with mysqld must be made via Unix sockets or named pipes.
75
+ # Note that using this option without enabling named pipes on Windows
76
+ # (via the "enable-named-pipe" option) will render mysqld useless!
77
+ #
78
+ # commented in by xampp security
79
+ #skip-networking
80
+ skip-networking
81
+
82
+ # Replication Master Server (default)
83
+ # binary logging is required for replication
84
+ # log-bin deactivated by default since XAMPP 1.4.11
85
+ #log-bin=mysql-bin
86
+
87
+ # required unique id between 1 and 2^32 - 1
88
+ # defaults to 1 if master-host is not set
89
+ # but will not function as a master if omitted
90
+ server-id = 1
91
+
92
+ # Replication Slave (comment out master section to use this)
93
+ #
94
+ # To configure this host as a replication slave, you can choose between
95
+ # two methods :
96
+ #
97
+ # 1) Use the CHANGE MASTER TO command (fully described in our manual) -
98
+ # the syntax is:
99
+ #
100
+ # CHANGE MASTER TO MASTER_HOST=<host>, MASTER_PORT=<port>,
101
+ # MASTER_USER=<user>, MASTER_PASSWORD=<password> ;
102
+ #
103
+ # where you replace <host>, <user>, <password> by quoted strings and
104
+ # <port> by the master's port number (3306 by default).
105
+ #
106
+ # Example:
107
+ #
108
+ # CHANGE MASTER TO MASTER_HOST='125.564.12.1', MASTER_PORT=3306,
109
+ # MASTER_USER='joe', MASTER_PASSWORD='secret';
110
+ #
111
+ # OR
112
+ #
113
+ # 2) Set the variables below. However, in case you choose this method, then
114
+ # start replication for the first time (even unsuccessfully, for example
115
+ # if you mistyped the password in master-password and the slave fails to
116
+ # connect), the slave will create a master.info file, and any later
117
+ # change in this file to the variables' values below will be ignored and
118
+ # overridden by the content of the master.info file, unless you shutdown
119
+ # the slave server, delete master.info and restart the slaver server.
120
+ # For that reason, you may want to leave the lines below untouched
121
+ # (commented) and instead use CHANGE MASTER TO (see above)
122
+ #
123
+ # required unique id between 2 and 2^32 - 1
124
+ # (and different from the master)
125
+ # defaults to 2 if master-host is set
126
+ # but will not function as a slave if omitted
127
+ #server-id = 2
128
+ #
129
+ # The replication master for this slave - required
130
+ #master-host = <hostname>
131
+ #
132
+ # The username the slave will use for authentication when connecting
133
+ # to the master - required
134
+ #master-user = <username>
135
+ #
136
+ # The password the slave will authenticate with when connecting to
137
+ # the master - required
138
+ #master-password = <password>
139
+ #
140
+ # The port the master is listening on.
141
+ # optional - defaults to 3306
142
+ #master-port = <port>
143
+ #
144
+ # binary logging - not required for slaves, but recommended
145
+ #log-bin=mysql-bin
146
+
147
+
148
+ # Point the following paths to different dedicated disks
149
+ tmpdir = /Applications/XAMPP/xamppfiles/temp/mysql
150
+ #log-update = /path-to-dedicated-directory/hostname
151
+
152
+ # Uncomment the following if you are using BDB tables
153
+ #bdb_cache_size = 4M
154
+ #bdb_max_lock = 10000
155
+
156
+ # Comment the following if you are using InnoDB tables
157
+ #skip-innodb
158
+ innodb_data_home_dir = /Applications/XAMPP/xamppfiles/var/mysql/
159
+ innodb_data_file_path = ibdata1:10M:autoextend
160
+ innodb_log_group_home_dir = /Applications/XAMPP/xamppfiles/var/mysql/
161
+ # You can set .._buffer_pool_size up to 50 - 80 %
162
+ # of RAM but beware of setting memory usage too high
163
+ innodb_buffer_pool_size = 16M
164
+ # Deprecated in 5.6
165
+ #innodb_additional_mem_pool_size = 2M
166
+ # Set .._log_file_size to 25 % of buffer pool size
167
+ innodb_log_file_size = 5M
168
+ innodb_log_buffer_size = 8M
169
+ innodb_flush_log_at_trx_commit = 1
170
+ innodb_lock_wait_timeout = 50
171
+
172
+ [mysqldump]
173
+ quick
174
+ max_allowed_packet = 16M
175
+
176
+ [mysql]
177
+ no-auto-rehash
178
+ # Remove the next comment character if you are not familiar with SQL
179
+ #safe-updates
180
+
181
+ [isamchk]
182
+ key_buffer = 20M
183
+ sort_buffer_size = 20M
184
+ read_buffer = 2M
185
+ write_buffer = 2M
186
+
187
+ [myisamchk]
188
+ key_buffer = 20M
189
+ sort_buffer_size = 20M
190
+ read_buffer = 2M
191
+ write_buffer = 2M
192
+
193
+ [mysqlhotcopy]
194
+ interactive-timeout
195
+
196
+ !include /Applications/XAMPP/xamppfiles/mysql/my.cnf
197
+
198
+ -show variables like 'char%';の結果
199
+ character_set_client utf8
200
+ character_set_connect utf8
201
+ character_set_database latin1
202
+ character_set_filesystem binary
203
+ character_set_results utf8
204
+ character_set_server latin1
205
+ character_set_system utf8
206
+ character_sets_dir /usr/local/mysql-5.6.25-osx10.8-x86_64/share/charsets/

1

MySQLの文字コードをutf8にする際に行ったことを詳細に記述しました。

2015/07/28 06:08

投稿

mysqlldutf8
mysqlldutf8

スコア10

title CHANGED
File without changes
body CHANGED
@@ -10,4 +10,16 @@
10
10
 
11
11
  開発環境はOS × Yosemite バージョン10.10.4で、server versionは5.6.25 MySQL Community Server (GPL)を使用しています。
12
12
 
13
- 分かる方がいれば、教えていただけると助かります。
13
+ 分かる方がいれば、教えていただけると助かります。
14
+
15
+ 初期状態のmy.cnfにmysqldとclientに書いてある通りの記述をしました。
16
+ 参照:http://qiita.com/YusukeHigaki/items/2cab311d2a559a543e3a
17
+
18
+ my.cnfを初期状態に戻し、my.cnfのmysqldumpとmysqlに書いてある通りの記述をしました。
19
+ 参照:http://mysqlx01.seesaa.net
20
+
21
+ my.cnfを初期状態に戻し、my.cnfのmysqldとclientとmysqlに書いてある通りの記述をしました。
22
+ 参照:http://www.dbonline.jp/mysql/myini/index3.html
23
+
24
+ my.cnfを初期状態に戻し、my.cnfにサイトに書いてあることの通りの記述をしました。
25
+ 参照:http://514design.jp/2013/01/mysql-character-set/