Bug #78936 Installing MySQL on Linux Using Debian Packages missing dependency
Submitted: 23 Oct 2015 9:33 Modified: 22 Dec 2015 22:56
Reporter: SQL Stunts Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:5.7 OS:Ubuntu (14.04)
Assigned to: Daniel So CPU Architecture:Any

[23 Oct 2015 9:33] SQL Stunts
Description:
While following the steps to install MySQL Community Server on a machine running Ubuntu Server 14.04, described on the following documentation:
https://dev.mysql.com/doc/refman/5.7/en/linux-installation-debian.html

When running the step:
sudo dpkg -i mysql-community-server_MVER-DVER_CPU.deb

There's the following error:
dpkg: dependency problems prevent configuration of mysql-community-server:
 mysql-community-server depends on mysql-client (= 5.7.9-1ubuntu14.04); however:
  Package mysql-client is not installed.

dpkg: error processing package mysql-community-server (--install):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 mysql-community-server

How to repeat:
Install MySQL Community Server on a Ubuntu linux server that doesn't have MySQL Client installed.

Suggested fix:
If you check the mysql-community-server package dependencies, you'll confirm that it does depend on the MySQL Client. Checking dependencies with:

apt-cache showpkg mysql-community-server

Will report:

Package: mysql-community-server
Versions: 
5.7.9-1ubuntu14.04 (/var/lib/dpkg/status)
 Description Language: 
                 File: /var/lib/dpkg/status
                  MD5: 9e45d505383d255f7dcd9299a5d329c0

Reverse Depends: 
Dependencies: 
5.7.9-1ubuntu14.04 - mysql-common (5 5.7.9-1ubuntu14.04) mysql-client (5 5.7.9-1ubuntu14.04) 
apparmor (0 (null)) psmisc (0 (null)) libaio1 (2 0.3.93) libc6 (2 2.17) libgcc1 (2 1:4.1.1) 
libmecab2 (2 0.996-1.1) libnuma1 (0 (null)) libstdc++6 (2 4.6) zlib1g (2 1:1.2.0) debconf (18 0.5) 
debconf-2.0 (0 (null)) debconf (2 0.2.17) adduser (0 (null)) mysql (0 (null)) mysql:i386 (0 (null)) 
mysql-commercial-server (0 (null)) mysql-commercial-server:i386 (0 (null)) 
mysql-server-5.0 (0 (null)) mysql-server-5.0:i386 (0 (null)) mysql-server-5.1 (0 (null)) 
mysql-server-5.1:i386 (0 (null)) mysql-server-5.5 (0 (null)) mysql-server-5.5:i386 (0 (null)) 
mysql-server-5.6 (0 (null)) mysql-server-5.6:i386 (0 (null)) mysql-server-5.7 (0 (null)) 
mysql-server-5.7:i386 (0 (null)) mysql-server-core-5.0 (0 (null)) mysql-server-core-5.0:i386 (0 (null)) 
mysql-server-core-5.1 (0 (null)) mysql-server-core-5.1:i386 (0 (null)) mysql-server-core-5.5 (0 (null)) 
mysql-server-core-5.5:i386 (0 (null)) mysql-server-core-5.6 (0 (null)) mysql-server-core-5.6:i386 (0 (null)) mysql-server-core-5.7 (0 (null)) 
mysql-server-core-5.7:i386 (0 (null)) mysql (0 (null)) mysql:i386 (0 (null)) mysql-commercial-server (0 (null)) 
mysql-commercial-server:i386 (0 (null)) mysql-server-5.0 (0 (null)) mysql-server-5.0:i386 (0 (null)) mysql-server-5.1 (0 (null)) 
mysql-server-5.1:i386 (0 (null)) mysql-server-5.5 (0 (null)) mysql-server-5.5:i386 (0 (null)) mysql-server-5.6 (0 (null)) mysql-server-5.6:i386 (0 (null)) 
mysql-server-5.7 (0 (null)) mysql-server-5.7:i386 (0 (null)) mysql-server-core-5.0 (0 (null)) mysql-server-core-5.0:i386 (0 (null)) 
mysql-server-core-5.1 (0 (null)) mysql-server-core-5.1:i386 (0 (null)) mysql-server-core-5.5 (0 (null)) mysql-server-core-5.5:i386 (0 (null)) 
mysql-server-core-5.6 (0 (null)) mysql-server-core-5.6:i386 (0 (null)) mysql-server-core-5.7 (0 (null)) mysql-server-core-5.7:i386 (0 (null)) 
Provides: 
5.7.9-1ubuntu14.04 - virtual-mysql-server-core virtual-mysql-server mysql-server-core-5.7 mysql-server-5.7 
Reverse Provides: 

To fix the documentation, just include a step before the Community server package, to install the client:
sudo dpkg -i mysql-client__MVER-DVER_CPU.deb
[23 Oct 2015 11:32] Lars Tangvald
Thank you for bringing this to our attention.

The instructions given are not in the correct order, and are also missing some updates for 5.7
[23 Oct 2015 12:24] Lars Tangvald
Posted by developer:
 
Docs team:
In addition to the incorrect order of the install commands, the page is also missing the commands for a couple of packages.
Additionally, the package libmysqlclient18 needs to be changed to libmysqlclient20.

There are two ways to correctly install the debs:

1. Install them in whatever order (this will generate dependency errors), then run apt-get install -f at the end.
 This will work, but since it generates error messages we should avoid it.

2. Install them all in correct order using dpkg. I'm noting one order that will work below, using Ubuntu 14.04 and amd64 as an example:

dpkg -i mysql-common_5.7.9-1ubuntu14.04_amd64.deb
dpkg -i mysql-community-client_5.7.9-1ubuntu14.04_amd64.deb
dpkg -i mysql-client_5.7.9-1ubuntu14.04_amd64.deb
dpkg -i mysql-community-client_5.7.9-1ubuntu14.04_amd64.deb
dpkg -i mysql-community-server_5.7.9-1ubuntu14.04_amd64.deb
dpkg -i mysql-server_5.7.9-1ubuntu14.04_amd64.deb

If the test suite is to be installed, we also need:
dpkg -i libmysqlclient20_5.7.9-1ubuntu14.04_amd64.deb
dpkg -i libmysqlclient-dev_5.7.9-1ubuntu14.04_amd64.deb
dpkg -i mysql-community-test_5.7.9-1ubuntu14.04_amd64.deb
dpkg -i mysql-testsuite_5.7.9-1ubuntu14.04_amd64.deb

Also note that the references to the dpkg-preconfigure command and test database can be removed.
[23 Oct 2015 12:36] Lars Tangvald
Posted by developer:
 
The above list should have been (I put mysql-community-client twice):

dpkg -i mysql-common_5.7.9-1ubuntu14.04_amd64.deb
dpkg -i mysql-community-client_5.7.9-1ubuntu14.04_amd64.deb
dpkg -i mysql-client_5.7.9-1ubuntu14.04_amd64.deb
dpkg -i mysql-community-server_5.7.9-1ubuntu14.04_amd64.deb
dpkg -i mysql-server_5.7.9-1ubuntu14.04_amd64.deb
[27 Oct 2015 19:33] Todd Farmer
Here's where I found it suggested it was caused by the default database:

http://stackoverflow.com/questions/27132697/mysql-error-empty-string-given-as-argument-for...

https://teamtreehouse.com/community/error-executing-query

Seems to be somewhat common.
[22 Dec 2015 22:56] Daniel So
The installation instructions for the MySQL 5.7 .deb packages in the MySQL 5.7 Reference Manual have been updated. Changes will be visible in the next build of the manual.