can';不要再启动mysql了

can';不要再启动mysql了,mysql,linux,ubuntu-12.04,Mysql,Linux,Ubuntu 12.04,在增加最大允许数据包值后,我试图重新启动我的“mysql”服务 重新启动时,我收到以下消息: jm@dev:/etc/mysql$ /etc/init.d/mysql restart Rather than invoking init scripts through /etc/init.d, use the service(8) utility, e.g. service mysql restart Since the script you are attempting to invoke h

在增加最大允许数据包值后,我试图重新启动我的“mysql”服务

重新启动时,我收到以下消息:

jm@dev:/etc/mysql$ /etc/init.d/mysql restart
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service mysql restart

Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the stop(8) and then start(8) utilities,
e.g. stop mysql ; start mysql. The restart(8) utility is also available.
stop: Rejected send message, 1 matched rules; type="method_call", sender=":1.481" (uid=1000 pid=6732 comm="stop mysql ") interface="com.ubuntu.Upstart0_6.Job" member="Stop" error name="(unset)" requested_reply="0" destination="com.ubuntu.Upstart" (uid=0 pid=1 comm="/sbin/init")
对max_allowed_数据包的更改似乎没有生效,因此我尝试:

jm@dev:/etc/mysql$ sudo stop mysql
[sudo] password for jm: 
mysql stop/waiting
jm@dev:/etc/mysql$ sudo start mysql
start: Job failed to start
我试图检查日志文件是否有错误,但/var/log/mysql/mysql.log为空

关于如何解决这个问题,有什么建议吗? 谢谢

编辑1

下面是my.cnf的外观:

#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
# 
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html

# This will be passed to all mysql clients
# It has been reported that passwords should be enclosed with ticks/quotes
# escpecially if they contain "#" chars...
# Remember to edit /etc/mysql/debian.cnf when changing the socket location.
[client]
port            = 3306
socket          = /var/run/mysqld/mysqld.sock

# Here is entries for some specific programs
# The following values assume you have at least 32M ram

# This was formally known as [safe_mysqld]. Both versions are currently parsed.
[mysqld_safe]
socket          = /var/run/mysqld/mysqld.sock
nice            = 0

[mysqld]
#
# * Basic Settings
#
user            = mysql
pid-file        = /var/run/mysqld/mysqld.pid
socket          = /var/run/mysqld/mysqld.sock
port            = 3306
basedir         = /usr
datadir         = /var/lib/mysql
tmpdir          = /tmp
lc-messages-dir = /usr/share/mysql
skip-external-locking
local-infile

#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
#
# * Fine Tuning
#
key_buffer              = 16M
max_allowed_packet      = 40M
thread_stack            = 192K
thread_cache_size       = 8
# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
myisam-recover         = BACKUP
#max_connections        = 100
#table_cache            = 64
#thread_concurrency     = 10
#
# * Query Cache Configuration
#
query_cache_limit       = 1M
query_cache_size        = 16M
#
# * Logging and Replication
#
# Both location gets rotated by the cronjob.
# Be aware that this log type is a performance killer.
# As of 5.1 you can enable the log at runtime!
#general_log_file        = /var/log/mysql/mysql.log
#general_log             = 1
#
# Error logging goes to syslog due to /etc/mysql/conf.d/mysqld_safe_syslog.cnf.
#
# Here you can see queries with especially long duration
#log_slow_queries       = /var/log/mysql/mysql-slow.log
#long_query_time = 2
#log-queries-not-using-indexes
#
# The following can be used as easy to replay backup logs or for replication.
# note: if you are setting up a replication slave, see README.Debian about
#       other settings you may need to change.
#server-id              = 1
#log_bin                        = /var/log/mysql/mysql-bin.log
expire_logs_days        = 10
max_binlog_size         = 100M
#binlog_do_db           = include_database_name
#binlog_ignore_db       = include_database_name
#
# * InnoDB
#
# InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
# Read the manual for more InnoDB related options. There are many!
#
# * Security Features
#
# Read the manual, too, if you want chroot!
# chroot = /var/lib/mysql/
#
# For generating SSL certificates I recommend the OpenSSL GUI "tinyca".
#
# ssl-ca=/etc/mysql/cacert.pem
# ssl-cert=/etc/mysql/server-cert.pem
# ssl-key=/etc/mysql/server-key.pem



[mysqldump]
quick
quote-names
max_allowed_packet      = 16M

[mysql]
#no-auto-rehash # faster start of mysql but no tab completition
local-infile

[isamchk]
key_buffer              = 16M

#
# * IMPORTANT: Additional settings that can override those from this file!
#   The files must end with '.cnf', otherwise they'll be ignored.
#
编辑2

在syslog中找到以下条目:

Sep 17 14:48:30 dev kernel: [456044.062568] init: mysql main process (8723) terminated with status 1
Sep 17 14:48:30 dev kernel: [456044.062606] init: mysql main process ended, respawning
Sep 17 14:48:31 dev kernel: [456045.071308] init: mysql post-start process (8724) terminated with status 1
Sep 17 14:48:31 dev kernel: [456045.080818] type=1400 audit(1379443711.030:42): apparmor="STATUS" operation="profile_replace" name="/usr/sbin/mysqld" pid=8749 comm="apparmor_parser"
Sep 17 14:48:31 dev kernel: [456045.094878] init: mysql main process (8753) terminated with status 1
Sep 17 14:48:31 dev kernel: [456045.094911] init: mysql main process ended, respawning
Sep 17 14:48:32 dev kernel: [456046.103060] init: mysql post-start process (8754) terminated with status 1
Sep 17 14:48:32 dev kernel: [456046.112910] type=1400 audit(1379443712.062:43): apparmor="STATUS" operation="profile_replace" name="/usr/sbin/mysqld" pid=8777 comm="apparmor_parser"
Sep 17 14:48:32 dev kernel: [456046.128208] init: mysql main process (8781) terminated with status 1
Sep 17 14:48:32 dev kernel: [456046.128240] init: mysql respawning too fast, stopped

在Ubuntu的askubuntu网站上,类似的问题似乎已经得到了回答

还可以尝试将以下内容添加到my.cnf

默认字符集=utf8

默认排序规则=utf8\u常规\u ci


似乎my.cnf上的权限不正确。 它们必须是:

-rw-r--r-- 1 root root 3505 apr 22 09:56 my.cnf

查看系统日志中的错误。日志被重定向到那里。我在syslog中发现了一些消息。现在要用谷歌搜索他们。。。但是如果你有任何建议,请告诉我。查看我的编辑2查看apparmor的mysql配置文件。检查路径是否正确并与您的.cnf文件的路径相匹配。Ander2,很抱歉,但我不明白您何时要求签出apparmor的配置文件。。。我该怎么做?很抱歉只是个新手。将在
/etc/apparmor.d/
文件夹中仔细检查路径.Loot。应该有一个类似于
usr.sbin.mysqld
的文件。打开它并检查路径。我没有卸载/安装。。在我重新启动之前,它工作得很好。这并不能回答这个问题。若要评论或要求作者澄清,请在其帖子下方留下评论。@JonLin这是op对他自己问题的回答