Ubuntu下启动、停止、重启MySQL,查看错误日志命令大全
1)启动:
sudo/etc/init.d/mysqlstart
2)停止:
sudo/etc/init.d/mysqlstop
3)重启:
sudo/etc/init.d/mysqlrestart
4)查看日志:
cat/var/log/mysql.err cat/var/log/mysql/error.log
5)不支持中文
修改/etc/mysql/my.cnf
在[client]下面增加:
default-character-set=utf8或character_set_server=utf8
在[mysqld]下面增加:
default-character-set=utf8或character_set_server=utf8
6)错误提示:unknownvariable'default-character-set=utf8'
修改配置文件/etc/mysql/my.cnf中的“default-character-set=utf8”为“character_set_server=utf8”