mysql修改mysqld.cnf文件后启动不了
Tofloor
poster avatar
shajia2646
deepin
2017-07-19 22:56
Author
mysql修改/etc/mysql/mysql.conf.d/mysqld.cnf文件后启动不了,就添加一行,然后删除了也启动不了,求各位帮帮忙,已经百度一天了,权限的问题都不是。
出错信息如下:
wjc@wjc-pc:~$ sudo /etc/init.d/mysql start
[sudo] wjc 的密码:
[....] Starting mysql (via systemctl): mysql.serviceJob for mysql.service failed because the control process exited with error code.
See "systemctl status mysql.service" and "journalctl -xe" for details.
failed!
wjc@wjc-pc:~$ systemctl status mysql.servic
Unit mysql.servic.service could not be found.
wjc@wjc-pc:~$ systemctl status mysql.service
● mysql.service - MySQL Community Server
   Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
   Active: activating (start-post) (Result: exit-code) since 三 2017-07-19 14:55:45 CST; 15s ago
  Process: 26255 ExecStart=/usr/sbin/mysqld (code=exited, status=1/FAILURE)
  Process: 26248 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
Main PID: 26255 (code=exited, status=1/FAILURE); Control PID: 26257 (mysql-systemd-s)
    Tasks: 2 (limit: 4915)
   CGroup: /system.slice/mysql.service
           └─control
             ├─26257 /bin/bash /usr/share/mysql/mysql-systemd-start post
             └─26801 mysqladmin ping
wjc@wjc-pc:~$



Reply Favorite View the author
All Replies
avatar
wangyingtao
deepin
2017-07-19 22:59
#1
See "systemctl status mysql.service" and "journalctl -xe" for details.

把这两条命令的输出贴上来下
Reply View the author
avatar
shajia2646
deepin
2017-07-19 23:40
#2
wjc@wjc-pc:~$ mysql -u root -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
wjc@wjc-pc:~$ journalctl -xe
Hint: You are currently not seeing messages from other users and the system.
      Users in groups 'adm', 'systemd-journal' can see all messages.
      Pass -q to turn off this notice.
7月 19 15:39:01 wjc-pc daemon/trayicon[1004]: icon.go:76: Add tray icon 102760463 name: "blueman-applet"
7月 19 15:39:01 wjc-pc daemon/dock[1004]: dock_manager_hide_state.go:191: activeWindow is 0
7月 19 15:39:01 wjc-pc daemon/dock[1004]: dock_manager_hide_state.go:255: try setPropHideState to Unknown
7月 19 15:39:02 wjc-pc daemon/dock[1004]: dock_manager_hide_state.go:191: activeWindow is 0
7月 19 15:39:02 wjc-pc daemon/dock[1004]: dock_manager_hide_state.go:255: try setPropHideState to Unknown
7月 19 15:39:05 wjc-pc daemon/trayicon[1004]: icon.go:76: Add tray icon 98566165 name: "sogou-qimpanel"
7月 19 15:39:06 wjc-pc daemon/dock[1004]: dock_manager_hide_state.go:191: activeWindow is 0
7月 19 15:39:06 wjc-pc daemon/dock[1004]: dock_manager_hide_state.go:255: try setPropHideState to Unknown
7月 19 15:39:07 wjc-pc daemon/trayicon[1004]: icon.go:76: Add tray icon 98566209 name: "sogou-qimpanel"
7月 19 15:39:08 wjc-pc daemon/dock[1004]: dock_manager_hide_state.go:191: activeWindow is 0
7月 19 15:39:08 wjc-pc daemon/dock[1004]: dock_manager_hide_state.go:255: try setPropHideState to Unknown
7月 19 15:39:19 wjc-pc daemon/bluetooth[1464]: device.go:215: auto connect device &{0xc420167b80 /org/bluez/hci0/dev_F4_CB_5
7月 19 15:39:24 wjc-pc daemon/bluetooth[1464]: utils_bluez.go:254: org.bluez.Error.Failed:Host is down
                                                  ->  device.go:216
                                                  ->  asm_amd64.s:2086
7月 19 15:39:35 wjc-pc daemon/dock[1004]: dock_manager_hide_state.go:66: getActiveWinGroup: not found active window in clien
7月 19 15:39:35 wjc-pc daemon/dock[1004]: xutils.go:196: GetProperty: No such property '_NET_WM_DESKTOP' on window 1600072.
7月 19 15:39:36 wjc-pc com.deepin.dde.ControlCenter[892]: 2017-07-19, 15:39:36.316 [Debug  ] [startupnotificationmonitor.cpp
7月 19 15:39:36 wjc-pc org.freedesktop.Notifications[892]: startup notification initiated:  dde-session-initializer-1004-wjc
7月 19 15:39:36 wjc-pc com.deepin.dde.ControlCenter[892]: 2017-07-19, 15:39:36.928 [Debug  ] [startupnotificationmonitor.cpp
7月 19 15:39:36 wjc-pc org.freedesktop.Notifications[892]: startup notification completed:  dde-session-initializer-1004-wjc
7月 19 15:39:51 wjc-pc org.freedesktop.Notifications[892]: startup notification initiated:  dde-session-initializer-1004-wjc
7月 19 15:39:51 wjc-pc com.deepin.dde.ControlCenter[892]: 2017-07-19, 15:39:51.485 [Debug  ] [startupnotificationmonitor.cpp
7月 19 15:39:56 wjc-pc com.deepin.dde.ControlCenter[892]: 2017-07-19, 15:39:56.476 [Debug  ] [startupnotificationmonitor.cpp
7月 19 15:39:56 wjc-pc org.freedesktop.Notifications[892]: startup notification completed:  dde-session-initializer-1004-wjc
7月 19 15:40:36 wjc-pc dbus-daemon[892]: Activating service name='com.deepin.api.XMouseArea'
7月 19 15:40:36 wjc-pc dbus-daemon[892]: Successfully activated service 'com.deepin.api.XMouseArea'
7月 19 15:40:37 wjc-pc daemon/dock[1004]: dock_manager_hide_state.go:66: getActiveWinGroup: not found active window in clien
7月 19 15:40:37 wjc-pc daemon/dock[1004]: xutils.go:196: GetProperty: No such property '_NET_WM_DESKTOP' on window 4e00004.
lines 1374-1402/1402 (END)
7月 19 15:39:01 wjc-pc daemon/trayicon[1004]: icon.go:76: Add tray icon 102760463 name: "blueman-applet"
7月 19 15:39:01 wjc-pc daemon/dock[1004]: dock_manager_hide_state.go:191: activeWindow is 0
7月 19 15:39:01 wjc-pc daemon/dock[1004]: dock_manager_hide_state.go:255: try setPropHideState to Unknown
7月 19 15:39:02 wjc-pc daemon/dock[1004]: dock_manager_hide_state.go:191: activeWindow is 0
7月 19 15:39:02 wjc-pc daemon/dock[1004]: dock_manager_hide_state.go:255: try setPropHideState to Unknown
7月 19 15:39:05 wjc-pc daemon/trayicon[1004]: icon.go:76: Add tray icon 98566165 name: "sogou-qimpanel"
7月 19 15:39:06 wjc-pc daemon/dock[1004]: dock_manager_hide_state.go:191: activeWindow is 0
7月 19 15:39:06 wjc-pc daemon/dock[1004]: dock_manager_hide_state.go:255: try setPropHideState to Unknown
7月 19 15:39:07 wjc-pc daemon/trayicon[1004]: icon.go:76: Add tray icon 98566209 name: "sogou-qimpanel"
7月 19 15:39:08 wjc-pc daemon/dock[1004]: dock_manager_hide_state.go:191: activeWindow is 0
7月 19 15:39:08 wjc-pc daemon/dock[1004]: dock_manager_hide_state.go:255: try setPropHideState to Unknown
7月 19 15:39:19 wjc-pc daemon/bluetooth[1464]: device.go:215: auto connect device &{0xc420167b80 /org/bluez/hci0/dev_F4_CB_52_3B_7F_D5 /org/bluez/hci0 Honor 8 Honor 8 true true 0 [00000000-0000-1000-8000-00805f9b34fb 0000046a-0000-1000-8000
7月 19 15:39:24 wjc-pc daemon/bluetooth[1464]: utils_bluez.go:254: org.bluez.Error.Failed:Host is down
                                                  ->  device.go:216
                                                  ->  asm_amd64.s:2086
7月 19 15:39:35 wjc-pc daemon/dock[1004]: dock_manager_hide_state.go:66: getActiveWinGroup: not found active window in clientListStacking
7月 19 15:39:35 wjc-pc daemon/dock[1004]: xutils.go:196: GetProperty: No such property '_NET_WM_DESKTOP' on window 1600072.
7月 19 15:39:36 wjc-pc com.deepin.dde.ControlCenter[892]: 2017-07-19, 15:39:36.316 [Debug  ] [startupnotificationmonitor.cpp monitor_event_func                  34] startup notification initiated:  dde-session-initializer-1004-wjc-pc-deepin
7月 19 15:39:36 wjc-pc org.freedesktop.Notifications[892]: startup notification initiated:  dde-session-initializer-1004-wjc-pc-deepin-terminal-0_TIME107834
7月 19 15:39:36 wjc-pc com.deepin.dde.ControlCenter[892]: 2017-07-19, 15:39:36.928 [Debug  ] [startupnotificationmonitor.cpp monitor_event_func                  42] startup notification completed:  dde-session-initializer-1004-wjc-pc-deepin
7月 19 15:39:36 wjc-pc org.freedesktop.Notifications[892]: startup notification completed:  dde-session-initializer-1004-wjc-pc-deepin-terminal-0_TIME107834
7月 19 15:39:51 wjc-pc org.freedesktop.Notifications[892]: startup notification initiated:  dde-session-initializer-1004-wjc-pc-firefox-1_TIME123004
7月 19 15:39:51 wjc-pc com.deepin.dde.ControlCenter[892]: 2017-07-19, 15:39:51.485 [Debug  ] [startupnotificationmonitor.cpp monitor_event_func                  34] startup notification initiated:  dde-session-initializer-1004-wjc-pc-firefo
7月 19 15:39:56 wjc-pc com.deepin.dde.ControlCenter[892]: 2017-07-19, 15:39:56.476 [Debug  ] [startupnotificationmonitor.cpp monitor_event_func                  42] startup notification completed:  dde-session-initializer-1004-wjc-pc-firefo
7月 19 15:39:56 wjc-pc org.freedesktop.Notifications[892]: startup notification completed:  dde-session-initializer-1004-wjc-pc-firefox-1_TIME123004
7月 19 15:40:36 wjc-pc dbus-daemon[892]: Activating service name='com.deepin.api.XMouseArea'
7月 19 15:40:36 wjc-pc dbus-daemon[892]: Successfully activated service 'com.deepin.api.XMouseArea'
7月 19 15:40:37 wjc-pc daemon/dock[1004]: dock_manager_hide_state.go:66: getActiveWinGroup: not found active window in clientListStacking
7月 19 15:40:37 wjc-pc daemon/dock[1004]: xutils.go:196: GetProperty: No such property '_NET_WM_DESKTOP' on window 4e00004.
~
Reply View the author
avatar
shajia2646
deepin
2017-07-19 23:41
#3
https://bbs.deepin.org/post/142817
See "systemctl status mysql.service" and "journalctl -xe" for details.

把这两条命令的输出贴上来下 ...

先在此谢过了。
Reply View the author
avatar
134******40
deepin
2017-07-19 23:46
#4
本帖最后由 jdocker 于 2017-7-19 15:51 编辑

把你的mysql配置信息粘贴到这里,我尝试帮助分析一下。当然你可以先执行
  1. sudo systemctl restart mysql.service
Copy the Code
然后再执行journalctl查看日志
  1. sudo journalctl -u mysql.service
Copy the Code
这时候会提供错误日志信息。

Reply View the author
avatar
shajia2646
deepin
2017-07-19 23:51
#5
#
# 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.

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

[mysqld_safe]
socket                = /var/run/mysqld/mysqld.sock
nice                = 0

[mysqld]
#
# * Basic Settings
#
____                = 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
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address                = 127.0.0.1
#
# * Fine Tuning
#
key_buffer_size                = 16M
max_allowed_packet        = 16M
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-options  = BACKUP
#max_connections        = 100
#table_open_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 log - should be very few entries.
#
log_error = /var/log/mysql/error.log
#
# Here you can see queries with especially long duration
#slow_query_log                = 1
#slow_query_log_file        = /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
Reply View the author
avatar
shajia2646
deepin
2017-07-19 23:51
#6
https://bbs.deepin.org/post/142817
把你的mysql配置信息粘贴到这里,我尝试帮助分析一下。

谢谢谢谢谢谢谢谢
Reply View the author
avatar
134******40
deepin
2017-07-19 23:56
#7
本帖最后由 jdocker 于 2017-7-19 16:01 编辑
https://bbs.deepin.org/post/142817
#
# The MySQL database server configuration file.
#

这里
____                = mysql
应该是
user              = mysql

“____” 明显是非法字符。肯定无法识别,除非复制信息出现错误了。
Reply View the author
avatar
134******40
deepin
2017-07-20 00:02
#8
https://bbs.deepin.org/post/142817
谢谢谢谢谢谢谢谢

如果按照要求还不行,可以看看mysql自身生成的错误日志。
  1. sudo gedit /var/log/mysql/error.log
Copy the Code

这里的错误就会提示的很明显。
Reply View the author
avatar
shajia2646
deepin
2017-07-20 00:03
#9
https://bbs.deepin.org/post/142817
这里
____                = mysql
应该是

可以了,多谢多谢
Reply View the author
avatar
shajia2646
deepin
2017-07-20 00:03
#10
在此 谢谢各位亲们的帮助!
Reply View the author
avatar
wangyingtao
deepin
2017-07-20 00:53
#11
改配置前,先备份一份,修改失败后,要比对一下。
先备份配置文件是很有必要的。
Reply View the author