Home >Database >Mysql Tutorial >Ubuntu下启动、停止、重启MySQL,查看错误日志命令大全_MySQL

Ubuntu下启动、停止、重启MySQL,查看错误日志命令大全_MySQL

WBOY
WBOYOriginal
2016-06-01 13:07:561011browse

Ubuntu

1)启动:

sudo /etc/init.d/mysql start

2)停止:

sudo /etc/init.d/mysql stop

3)重启:

sudo /etc/init.d/mysql restart

4)查看日志:

cat /var/log/mysql.errcat /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)错误提示:unknown variable 'default-character-set=utf8'

修改配置文件 /etc/mysql/my.cnf 中的“default-character-set=utf8” 为 “character_set_server=utf8”

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn