1、关于四种字符集的问题
1、查看当前的系统字符集\s;2、更改字符集
vim /etc/my.cnf [client] default-character-set=utf8 [mysqld] character-set-server=utf-8 collation-server=utf_general_ci
show variables like 'log_bin%';
vim /etc/my.cnf [mysqld] log-bin=/usr/local/mysql/log/mysql-bin
show variables like '%slow%';
show variables like '%query%';
set global slow_query_log='ON';
set global long_query_time=2;
vim /etc/my.cnf [mysqld] slow_query_log_file=/usr/local/mysql/log/log/slow.log
[client] socket=/tmp/mysql.socket [mysqld] socket=/tmp/mysql.socket
mysql -u root -p1234 --protocol tcp -hlocalhost
service mysqld stop
mysqld_safe --skip-grant-tables --user=mysql &
mysql -u root
update user set password = password("1234") where user='root' and host = 'localhost';