mysql字符集
mysql.cnf添加
[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、通过rpm包安装的MySQL
service mysqld restart
/etc/inint.d/mysqld start
2、从源码包安装的MySQL
// linux关闭MySQL的命令
$mysql_dir/bin/mysqladmin -uroot -p shutdown
// linux启动MySQL的命令
$mysql_dir/bin/mysqld_safe &
其中mysql_dir为MySQL的安装目录,mysqladmin和mysqld_safe位于MySQL安装目录的bin目录下。
3、以上方法都无效的时候,可以通过强行命令:“killall mysqld”来关闭MySQL。