Saya mencoba mengubah charset untuk MySQL kami melalui my.cnf dan gagal. Saya menambahkan pengaturan charset yang tercantum di bawah:
# The MySQL server
[mysqld]
port = 3306
socket = /var/lib/mysql/mysql.sock
skip-locking
key_buffer = 16M
max_allowed_packet = 1M
table_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
# ------------- MYSQL CHARSETS --------------
character_set_system = utf8
character_set_server = utf8
character_set_results = utf8
character_set_database = utf8
character_set_connection = utf8
character_set_client = utf8
collation_connection = utf8_general_ci
collation_database = utf8_general_ci
collation_server = utf8_general_ci
Ketika saya mengaktifkan ini, MySQL gagal memulai. Bagaimana saya bisa memastikan semuanya default utf8 - selalu?
Memperbarui
Masih ada beberapa tempat yang mengalami masalah dalam menjadi UTF8
character_set_client utf8
character_set_connection utf8
character_set_database latin1
character_set_filesystem binary
character_set_results utf8
character_set_server latin1
character_set_system utf8
character_sets_dir /usr/share/mysql/charsets/
collation_connection utf8_general_ci
collation_database latin1_swedish_ci
collation_server latin1_swedish_ci
Sayangnya saya masih belum menemukan soluton ... ada ide?
Saat ini saya berhasil menggunakan konfigurasi ini:
[mysqld]
default-character-set = utf8
init-connect='SET NAMES utf8'
character-set-server = utf8
[mysql]
default-character-set = utf8
Tapi PHPMyAdmin masih menunjukkan beberapa latin1
character_set_client utf8
character_set_connection utf8
character_set_database latin1
character_set_filesystem binary
character_set_results utf8
character_set_server latin1
character_set_system utf8
character_sets_dir /usr/share/mysql/charsets/
collation_connection utf8_general_ci
collation_database latin1_swedish_ci
collation_server latin1_swedish_ci