升级到 5.6 后 mysql 无法启动-权限被拒绝

升级到 5.6 后 mysql 无法启动-权限被拒绝

我正在运行 Ubuntu 14。上周我在本地尝试了一些 PDF 工具,在尝试安装时,pdftk我提到了依赖性问题,需要将我的 5.5 安装升级到 5.6。我希望保存输出,但遗憾的是我没有。到目前为止,我已经删除了所有内容mysql,并尝试重新开始,除了我的配置

root@ubuntu:~# dpkg --get-selections | grep -v deinstall | grep mysql
root@ubuntu:~# 

尝试安装mysql-server

root@ubuntu:~# apt-get install mysql-server
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  libdbd-mysql-perl libdbi-perl libmysqlclient18 libterm-readkey-perl
  mysql-client-5.6 mysql-client-core-5.6 mysql-common mysql-server-5.6
  mysql-server-core-5.6
Suggested packages:
  libmldbm-perl libnet-daemon-perl libplrpc-perl libsql-statement-perl tinyca
Recommended packages:
  mysql-common-5.6
The following NEW packages will be installed:
  libdbd-mysql-perl libdbi-perl libmysqlclient18 libterm-readkey-perl
  mysql-client-5.6 mysql-client-core-5.6 mysql-common mysql-server
  mysql-server-5.6 mysql-server-core-5.6
0 upgraded, 10 newly installed, 0 to remove and 110 not upgraded.
Need to get 22.9 MB of archives.
After this operation, 166 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://us.archive.ubuntu.com/ubuntu/ trusty/main libdbi-perl amd64 1.630-1 [879 kB]
Get:2 http://ppa.launchpad.net/ondrej/mysql-5.6/ubuntu/ trusty/main mysql-common all 5.6.25-3+deb.sury.org~trusty+1 [75.9 kB]
Get:3 http://ppa.launchpad.net/ondrej/mysql-5.6/ubuntu/ trusty/main libmysqlclient18 amd64 5.6.25-3+deb.sury.org~trusty+1 [738 kB]
Get:4 http://us.archive.ubuntu.com/ubuntu/ trusty/main libdbd-mysql-perl amd64 4.025-1 [99.3 kB]
Get:5 http://us.archive.ubuntu.com/ubuntu/ trusty/main libterm-readkey-perl amd64 2.31-1 [27.4 kB]
Get:6 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/universe mysql-client-core-5.6 amd64 5.6.27-0ubuntu0.14.04.1 [4,481 kB]
Get:7 http://ppa.launchpad.net/ondrej/mysql-5.6/ubuntu/ trusty/main mysql-server all 5.6.25-3+deb.sury.org~trusty+1 [73.4 kB]
Get:8 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/universe mysql-client-5.6 amd64 5.6.27-0ubuntu0.14.04.1 [5,843 kB]
Get:9 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/universe mysql-server-core-5.6 amd64 5.6.27-0ubuntu0.14.04.1 [4,858 kB]
Get:10 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/universe mysql-server-5.6 amd64 5.6.27-0ubuntu0.14.04.1 [5,826 kB]
Fetched 22.9 MB in 6s (3,666 kB/s)                                             
Preconfiguring packages ...
Selecting previously unselected package mysql-common.
(Reading database ... 239594 files and directories currently installed.)
Preparing to unpack .../mysql-common_5.6.25-3+deb.sury.org~trusty+1_all.deb ...
Unpacking mysql-common (5.6.25-3+deb.sury.org~trusty+1) ...
Selecting previously unselected package libmysqlclient18:amd64.
Preparing to unpack .../libmysqlclient18_5.6.25-3+deb.sury.org~trusty+1_amd64.deb ...
Unpacking libmysqlclient18:amd64 (5.6.25-3+deb.sury.org~trusty+1) ...
Selecting previously unselected package libdbi-perl.
Preparing to unpack .../libdbi-perl_1.630-1_amd64.deb ...
Unpacking libdbi-perl (1.630-1) ...
Selecting previously unselected package libdbd-mysql-perl.
Preparing to unpack .../libdbd-mysql-perl_4.025-1_amd64.deb ...
Unpacking libdbd-mysql-perl (4.025-1) ...
Selecting previously unselected package libterm-readkey-perl.
Preparing to unpack .../libterm-readkey-perl_2.31-1_amd64.deb ...
Unpacking libterm-readkey-perl (2.31-1) ...
Selecting previously unselected package mysql-client-core-5.6.
Preparing to unpack .../mysql-client-core-5.6_5.6.27-0ubuntu0.14.04.1_amd64.deb ...
Unpacking mysql-client-core-5.6 (5.6.27-0ubuntu0.14.04.1) ...
Selecting previously unselected package mysql-client-5.6.
Preparing to unpack .../mysql-client-5.6_5.6.27-0ubuntu0.14.04.1_amd64.deb ...
Unpacking mysql-client-5.6 (5.6.27-0ubuntu0.14.04.1) ...
Selecting previously unselected package mysql-server-core-5.6.
Preparing to unpack .../mysql-server-core-5.6_5.6.27-0ubuntu0.14.04.1_amd64.deb ...
Unpacking mysql-server-core-5.6 (5.6.27-0ubuntu0.14.04.1) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Setting up mysql-common (5.6.25-3+deb.sury.org~trusty+1) ...
Selecting previously unselected package mysql-server-5.6.
(Reading database ... 239961 files and directories currently installed.)
Preparing to unpack .../mysql-server-5.6_5.6.27-0ubuntu0.14.04.1_amd64.deb ...
Unpacking mysql-server-5.6 (5.6.27-0ubuntu0.14.04.1) ...
Selecting previously unselected package mysql-server.
Preparing to unpack .../mysql-server_5.6.25-3+deb.sury.org~trusty+1_all.deb ...
Unpacking mysql-server (5.6.25-3+deb.sury.org~trusty+1) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Processing triggers for ureadahead (0.100.0-16) ...
ureadahead will be reprofiled on next reboot
Setting up libmysqlclient18:amd64 (5.6.25-3+deb.sury.org~trusty+1) ...
Setting up libdbi-perl (1.630-1) ...
Setting up libdbd-mysql-perl (4.025-1) ...
Setting up libterm-readkey-perl (2.31-1) ...
Setting up mysql-client-core-5.6 (5.6.27-0ubuntu0.14.04.1) ...
Setting up mysql-client-5.6 (5.6.27-0ubuntu0.14.04.1) ...
Setting up mysql-server-core-5.6 (5.6.27-0ubuntu0.14.04.1) ...
Setting up mysql-server-5.6 (5.6.27-0ubuntu0.14.04.1) ...
start: Job failed to start
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing package mysql-server-5.6 (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of mysql-server:
 mysql-server depends on mysql-server-5.6; however:
  Package mysql-server-5.6 is not configured yet.

dpkg: error processing package mysql-server (--configure):
 dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.19-0ubuntu6.6) ...
No apport report written because the error message indicates its a followup error from a previous failure.
Erors were encountered while processing:
 mysql-server-5.6
 mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@ubuntu:~# 

我在其他一些 SO 问题中看到了这样的调试启动脚本

root@ubuntu:~# bash -xv /etc/init.d/mysql start
#!/bin/bash
#
### BEGIN INIT INFO

... <snipped out the script it dumps> ...

esac
+ case "${1:-''}" in
+ sanity_checks
+ '[' '!' -r /etc/mysql/my.cnf ']'
mysqld_get_param datadir
++ mysqld_get_param datadir
++ /usr/sbin/mysqld --print-defaults
++ tr ' ' '\n'
++ tail -n 1
++ cut -d= -f2
++ grep -- --datadir
/usr/sbin/mysqld: Can't read dir of '/etc/mysql/mysql.conf.d/' (Errcode: 13 - Permission denied)
Fatal error in defaults handling. Program aborted
+ datadir=
+ LC_ALL=C
+ tail -n 1
+ BLOCKSIZE=
+ df --portability /.
+ awk '{ exit ($4>4096) }'
+ log_daemon_msg 'Starting MySQL database server' mysqld
+ '[' -z 'Starting MySQL database server' ']'
+ log_use_fancy_output
+ TPUT=/usr/bin/tput
+ EXPR=/usr/bin/expr
+ '[' -t 1 ']'
+ '[' xxterm '!=' x ']'
+ '[' xxterm '!=' xdumb ']'
+ '[' -x /usr/bin/tput ']'
+ '[' -x /usr/bin/expr ']'
+ /usr/bin/tput hpa 60
+ /usr/bin/tput setaf 1
+ '[' -z ']'
+ FANCYTTY=1
+ case "$FANCYTTY" in
+ true
+ /usr/bin/tput xenl
$TPUT cols
++ /usr/bin/tput cols
+ COLS=80
+ '[' 80 ']'
+ '[' 80 -gt 6 ']'
$EXPR $COLS - 7
++ /usr/bin/expr 80 - 7
+ COL=73
+ log_use_plymouth
+ '[' n = y ']'
+ plymouth --ping
+ printf ' * Starting MySQL database server mysqld       '
 * Starting MySQL database server mysqld       $EXPR $COLS - 1
++ /usr/bin/expr 80 - 1
+ /usr/bin/tput hpa 79
                                                                               + printf ' '
 + mysqld_status check_alive nowarn
$MYADMIN ping 2>&1
++ /usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf ping
+ ping_output='/usr/bin/mysqladmin: connect to server at '\''localhost'\'' failed
error: '\''Can'\''t connect to local MySQL server through socket '\''/var/run/mysqld/mysqld.sock'\'' (2)'\''
Check that mysqld is running and that the socket: '\''/var/run/mysqld/mysqld.sock'\'' exists!'
+ ping_alive=0
+ ps_alive=0

但我的所有权限似乎都在那里

root@ubuntu:~# ll /etc/mysql/
total 40
drwxr-xr-x   4 root root  4096 Dec 15 07:43 ./
drwxr-xr-x 163 root root 12288 Dec 15 07:43 ../
drwxr-xr-x   2 root root  4096 Dec 15 07:43 conf.d/
-rw-------   1 root root   333 Dec 31  2013 debian.cnf
-rwxr-xr-x   1 root root  1220 Oct 26 19:25 debian-start*
lrwxrwxrwx   1 root root    24 Oct 14 13:41 my.cnf -> /etc/alternatives/my.cnf
-rw-r--r--   1 root root   839 Sep  8 10:17 my.cnf.fallback
-rw-r--r--   1 root root   682 Sep  8 10:17 mysql.cnf
drwxr-xr-x   2 root root  4096 Oct 14 13:42 mysql.conf.d/
root@ubuntu:~# ll /etc/mysql/mysql.conf.d/
total 16
drwxr-xr-x 2 root root 4096 Oct 14 13:42 ./
drwxr-xr-x 4 root root 4096 Dec 15 07:43 ../
-rw-r--r-- 1 root root 3025 Oct 14 13:44 mysqld.cnf
-rw-r--r-- 1 root root   21 Sep  8 10:17 mysqld_safe_syslog.cnf
root@ubuntu:~# ll /etc/mysql/conf.d/
total 20
drwxr-xr-x 2 root root 4096 Dec 15 07:43 ./
drwxr-xr-x 4 root root 4096 Dec 15 07:43 ../
-rw-r--r-- 1 root root    8 Sep  8 10:17 mysql.cnf
-rw-r--r-- 1 root root   21 Oct 22  2013 mysqld_safe_syslog.cnf
-rw-r--r-- 1 root root   55 Sep  8 10:17 mysqldump.cnf
root@ubuntu:~# 

还有什么原因可能导致此权限错误?

相关内容