MYSQL.CNF add
[Mysqld]
Character-set-server=utf8
Collation-server=utf8_general_ci
[Client]
Default-character-set=utf8
[MySQL]
Default-character-set=utf8
drop database user;
CREATE DATABASE IF not EXISTS user character set UTF8;
CREATE DATABASE IF not EXISTS user DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
Create database youdb character set UTF8;
Show variables like "%char%";
Character-set-server=utf8
Collation-server=utf8_general_ci
[Client]
Default-character-set=utf8;
[MySQL]
Default-character-set=utf8
[Client]
Default-character-set=utf8
[Mysqld]
Character-set-server=utf8
1. mysql installed via RPM package
Service mysqld Restart
/etc/inint.d/mysqld start
2. mysql installed from the source package
Linux shutdown mysql Command
$mysql _dir/bin/mysqladmin-uroot-p shutdown
Linux commands to start MySQL
$mysql _dir/bin/mysqld_safe &
Where Mysql_dir is the MySQL installation directory, mysqladmin and Mysqld_safe are located in the bin directory of the MySQL installation directory.
3, the above methods are invalid, you can by force command: "Killall mysqld" to shut down MySQL.
MySQL Character set