0
  • I've got a fresh installation of Ubuntu server 14.04.
  • I have successfully installed php7.

But I'm getting an error when trying to install mysql-server / mysql-server-5.6.

I'm getting the following output:

After this operation, 0 B of additional disk space will be used.
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.
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          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
Errors were encountered while processing:
 mysql-server-5.6
 mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

Searching whole evening for a solution (5 hours already) but can't figure it out. I've tried too many things to list here.

How I first installed php7: - https://bjornjohansen.no/upgrade-to-php7

Solutions I tried:

Somehow managed to get this error (not anymore): - ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

Tried many more things that I can't even remember

Community
  • 1
  • 1
Tim van Uum
  • 1,873
  • 1
  • 17
  • 36
  • So did you manage to clean up/purge your mysql installation? And or configure mysql-server-5.6? Another ting might be make sure to run `apt-get update` Before doing any installation. – E_p Dec 15 '15 at 23:14
  • Yes, had it removed. Also deleted the folder /etc/mysql. Tried to reconfigure. Done an apt-get update before. Nothing worked. Getting the same error. – Tim van Uum Dec 16 '15 at 06:13
  • Did you check error logs? One other option to try to install mariadb(fork and drop in replacement of MySQL) `apt-get install mariadb-server` Unless you need some specific functionality from mysql. Use PHP mysql driver to work with it. https://mariadb.org/. Did check PHP 7 repository nothing funky there. – E_p Dec 16 '15 at 16:16
  • This question is more suited for http://askubuntu.com – miken32 Dec 22 '15 at 20:30

2 Answers2

0

You can solve running this command

sudo apt-get install php-mysql

0

Try this (php5):

sudo apt-get install php 5-mysql
sudo apt-get update

Or this (php 7):

sudo apt update
sudo apt install php7.0-fpm php7.0-mysql

Then you will probably need to restart your webserver. E.g:

sudo service apache2 restart
Henry
  • 7,721
  • 2
  • 38
  • 38