1. 启动/停止/重启/状态
service mysqld start
service mysqld stop
service mysqld restart
service mysqld status
mysqld 是守护进程脚本,init.d 不是mysql的home
2. home/进入控制台
/usr/lib64/mysql
mysql -uroot -p
- 切换数据库
use somedb
- 查看该数据库字符集
show variables like 'character%';
+--------------------------+----------------------------+ | Variable_name | Value | +--------------------------+----------------------------+ | character_set_client | utf8 | | character_set_connection | utf8 | | character_set_database | utf8 | | character_set_filesystem | binary | | character_set_results | utf8 | | character_set_server | latin1 | | character_set_system | utf8 | | character_sets_dir | /usr/share/mysql/charsets/ | +--------------------------+----------------------------+
- 乱码的原因就是 latin1
- 编辑mysql配置文件位于home (my.cnf/my.ini : linux/window)
[mysql]
default-character-set=utf8
[mysqld]
character-set-server=utf8
重启即可
标签:中文,set,service,utf8,参是,character,乱码,mysqld,mysql From: https://www.cnblogs.com/zno2/p/6443544.html