Gentoo Archives: gentoo-user

From: Joseph <syscon780@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] php database character set
Date: Mon, 26 May 2014 00:06:08
Message-Id: 20140526000619.GC11936@syscon7
In Reply to: Re: [gentoo-user] php database character set by Michael Orlitzky
1 On 05/25/14 19:32, Michael Orlitzky wrote:
2 >On 05/25/2014 05:38 PM, Joseph wrote:
3 >> My php database, address book is set to (according to phpmyadmin):
4 >> Collation: utf8_general_ci
5 >>
6 >
7 >The collation determines e.g. how strings are sorted, but that doesn't
8 >mean the database supports utf-8 (although MySQL should by default these
9 >days).
10 >
11 >Try adding,
12 >
13 > [client]
14 > default-character-set = utf8
15 >
16 > [mysqld]
17 > character-set-server = utf8
18 >
19 >to your /etc/mysql/my.cnf.
20 >
21 >Then, in mysql, run,
22 >
23 > show create database $your_database;
24 >
25 >This will show you the default character set, like,
26 >
27 > /*!40100 DEFAULT CHARACTER SET utf8 */
28 >
29 >If it says utf8 and you've got those lines in my.cnf, you're in good
30 >shape, and your console test (at least) should work. Getting PHP to play
31 >along is another adventure, but take it one step at a time.
32
33 In /etc/mysql/my.cnf
34 I have them as default
35
36 [client]
37 default-character-set = utf8
38
39 [mysqld]
40 character-set-server = utf8
41
42
43 --
44 Joseph

Replies

Subject Author
Re: [gentoo-user] php database character set Michael Orlitzky <mjo@g.o>