我运行了 MySQL ... 以及许多不同的数据库。我今天安装了 MySQL Workbench.. 并且能够创建任何实体关系图等。然后我决定增加 max_allowed_packet 设置的大小并重新启动服务。不幸的是,服务无法重新启动。我检查了我的系统日志,并收到以下错误:
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
我在这个网站上找到了另一篇有类似问题的帖子,它建议运行dpkg-重新配置。
结果如下:
jm@dev:/var/log$ sudo dpkg-reconfigure mysql-server-5.5
[sudo] password for jm:
Warning: World-writable config file '/etc/mysql/my.cnf' is ignored
130917 14:52:57 [Note] Plugin 'FEDERATED' is disabled.
130917 14:52:57 InnoDB: The InnoDB memory heap is disabled
130917 14:52:57 InnoDB: Mutexes and rw_locks use GCC atomic builtins
130917 14:52:57 InnoDB: Compressed tables use zlib 1.2.3.4
130917 14:52:57 InnoDB: Initializing buffer pool, size = 128.0M
130917 14:52:57 InnoDB: Completed initialization of buffer pool
130917 14:52:57 InnoDB: highest supported file format is Barracuda.
130917 14:52:58 InnoDB: Waiting for the background threads to start
130917 14:52:59 InnoDB: 1.1.8 started; log sequence number 477426000
130917 14:52:59 [Warning] Neither --relay-log nor --relay-log-index were used; so replication may break when this MySQL server acts as a slave and has his hostname changed!! Please use '--relay-log=dev-relay-bin' to avoid this problem.
130917 14:52:59 [ERROR] /usr/sbin/mysqld: File './dev-relay-bin.index' not found (Errcode: 13)
130917 14:52:59 [ERROR] Failed in open_log() called from init_relay_log_info()
130917 14:52:59 [ERROR] Failed to initialize the master info structure
130917 14:52:59 InnoDB: Starting shutdown...
130917 14:52:59 InnoDB: Shutdown completed; log sequence number 477426000
start: Job failed to start
invoke-rc.d: initscript mysql, action "start" failed.
jm@dev:/var/log$
如有任何关于如何修复的建议,我们将不胜感激!
答案1
警告:可全局写入的配置文件‘/etc/mysql/my.cnf’被忽略
这就是你的问题。你更改了文件的权限,所以你可以编辑它,但 MySQL 拒绝让你使用它。
权限应该是:
-rw-r--r-- 1 root root 3505 apr 22 09:56 my.cnf
而已。