Bug #82454 Bug in Mysql 5.6 Installation in Xenial
Submitted: 4 Aug 2016 10:51 Modified: 13 Jan 2017 7:44
Reporter: Puneet Dhiman Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Installing Severity:S2 (Serious)
Version:5.6 OS:Ubuntu (Xenial)
Assigned to: CPU Architecture:Any

[4 Aug 2016 10:51] Puneet Dhiman
Description:
i am installing mysql-cummunity-server on xenial 
Vagrant 1.8.1 7 

Using Distributor ID:	Ubuntu
Description:	Ubuntu 16.04 LTS
Release:	16.04
Codename:	xenial

Intially I donot have mysql server 5.6 in apt cache of xenial then i add 

add the mysql key and repo for mysql 5.6 in /etc/apt/source.list.d/mysql.list

deb http://repo.mysql.com/apt/ubuntu/ xenial mysql-apt-config
deb http://repo.mysql.com/apt/ubuntu/ xenial mysql-5.6
 
Key: 

 wget -qO - http://repo.mysql.com/RPM-GPG-KEY-mysql | sudo apt-key add -

And the update the cache 
then run apt-get install mysql-community-server below logs are shown: 
sudo apt-get install mysql-community-server
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  libaio1 mysql-common:i386
Recommended packages:
  mysql-client
The following NEW packages will be installed:
  libaio1 mysql-common:i386 mysql-community-server
0 upgraded, 3 newly installed, 0 to remove and 103 not upgraded.
Need to get 14.6 MB of archives.
After this operation, 100 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
WARNING: The following packages cannot be authenticated!
  mysql-common:i386 mysql-community-server
Install these packages without verification? [y/N] y
Get:1 http://us.archive.ubuntu.com/ubuntu xenial/main amd64 libaio1 amd64 0.3.110-2 [6,356 B]
Get:2 http://repo.mysql.com/apt/ubuntu xenial/mysql-5.6 i386 mysql-common i386 5.6.32-1ubuntu16.04 [216 kB]
Get:3 http://repo.mysql.com/apt/ubuntu xenial/mysql-5.6 amd64 mysql-community-server amd64 5.6.32-1ubuntu16.04 [14.4 MB]
Fetched 14.6 MB in 1s (11.6 MB/s)                  
Preconfiguring packages ...
Selecting previously unselected package mysql-common:i386.
(Reading database ... 93031 files and directories currently installed.)
Preparing to unpack .../mysql-common_5.6.32-1ubuntu16.04_i386.deb ...
Unpacking mysql-common:i386 (5.6.32-1ubuntu16.04) ...
Selecting previously unselected package libaio1:amd64.
Preparing to unpack .../libaio1_0.3.110-2_amd64.deb ...
Unpacking libaio1:amd64 (0.3.110-2) ...
Selecting previously unselected package mysql-community-server.
Preparing to unpack .../mysql-community-server_5.6.32-1ubuntu16.04_amd64.deb ...
Unpacking mysql-community-server (5.6.32-1ubuntu16.04) ...
Processing triggers for libc-bin (2.23-0ubuntu3) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for systemd (229-4ubuntu4) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up mysql-common:i386 (5.6.32-1ubuntu16.04) ...
update-alternatives: using /etc/mysql/my.cnf.fallback to provide /etc/mysql/my.cnf (my.cnf) in auto mode
Setting up libaio1:amd64 (0.3.110-2) ...
Setting up mysql-community-server (5.6.32-1ubuntu16.04) ...
update-alternatives: using /etc/mysql/mysql.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode
2016-08-04 10:47:24 0 [Note] /usr/sbin/mysqld (mysqld 5.6.32) starting as process 24420 ...
2016-08-04 10:47:26 0 [Note] /usr/sbin/mysqld (mysqld 5.6.32) starting as process 24443 ...
2016-08-04 10:47:28 0 [Note] mysqld (mysqld 5.6.32) starting as process 24469 ...

it hangs out there only 

in /var/log/mysql/error.log/

sudo tailf /var/log/mysql/error.log
2016-08-04 10:47:31 24853 [Note] InnoDB: 128 rollback segment(s) are active.
2016-08-04 10:47:31 24853 [Note] InnoDB: Waiting for purge to start
2016-08-04 10:47:31 24853 [Note] InnoDB: 5.6.32 started; log sequence number 1625997
2016-08-04 10:47:31 24853 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: d850adb9-5a30-11e6-9efa-0800272f2dc9.
2016-08-04 10:47:31 24853 [Note] Server hostname (bind-address): '127.0.0.1'; port: 3306
2016-08-04 10:47:31 24853 [Note]   - '127.0.0.1' resolves to '127.0.0.1';
2016-08-04 10:47:31 24853 [Note] Server socket created on IP: '127.0.0.1'.
2016-08-04 10:47:31 24853 [Note] Event Scheduler: Loaded 0 events
2016-08-04 10:47:31 24853 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.6.32'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  MySQL Community Server (GPL)

and in syslogs 

sudo tailf /var/log/syslog
Aug  4 10:47:30 ubuntu16 kernel: [ 2806.821539] audit: type=1400 audit(1470307650.921:7): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/sbin/mysqld" pid=24501 comm="apparmor_parser"
Aug  4 10:47:31 ubuntu16 systemd[1]: message repeated 3 times: [ Reloading.]
Aug  4 10:47:31 ubuntu16 systemd[1]: Starting MySQL Community Server...
Aug  4 10:47:31 ubuntu16 mysql-systemd-start[24571]: /usr/share/mysql/mysql-systemd-start: line 73: /lib/init/apparmor-profile-load: No such file or directory
Aug  4 10:47:31 ubuntu16 mysqld_safe[24578]: 160804 10:47:31 mysqld_safe Logging to '/var/log/mysql/error.log'.
Aug  4 10:47:31 ubuntu16 mysqld_safe[24578]: 160804 10:47:31 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
Aug  4 10:47:31 ubuntu16 kernel: [ 2807.228486] audit: type=1400 audit(1470307651.333:8): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/24853/status" pid=24853 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=110 ouid=110
Aug  4 10:47:31 ubuntu16 kernel: [ 2807.228561] audit: type=1400 audit(1470307651.333:9): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/sys/devices/system/node/" pid=24853 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=110 ouid=0
Aug  4 10:47:31 ubuntu16 kernel: [ 2807.228616] audit: type=1400 audit(1470307651.333:10): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/proc/24853/status" pid=24853 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=110 ouid=110
Aug  4 10:47:31 ubuntu16 kernel: [ 2807.229087] audit: type=1400 audit(1470307651.333:11): apparmor="DENIED" operation="open" profile="/usr/sbin/mysqld" name="/usr/my.cnf" pid=24853 comm="mysqld" requested_mask="r" denied_mask="r" fsuid=110 ouid=0

and it is still hangs out
 

How to repeat:
Please resolve my problem so that i can use mysql 5.6 on xenial or tell me solution for it
[4 Aug 2016 11:18] MySQL Verification Team
We're sorry, but the bug system is not the appropriate forum for asking help on using MySQL products. Your problem is not the result of a bug.

Support on using our products is available both free in our forums at http://forums.mysql.com/ and for a reasonable fee direct from our skilled support engineers at http://www.mysql.com/support/

If you see syslog entries, AppArmor is preventing mysqld from accessing files. See some details are in the official oracle blogs - https://blogs.oracle.com/jsmyth/entry/apparmor_and_mysql

And https://dev.mysql.com/doc/mysql-security-excerpt/5.6/en/starting-server-troubleshooting.ht...

Thank you for your interest in MySQL.
[4 Aug 2016 11:46] Lars Tangvald
Hi,

MySQL tends to look for config files etc. in various locations that are not enabled by the default apparmor profiles, so not all such entries in the log are due to config errors.

From the logs it seems like the server is starting as it should, but systemd doesn't realize (so it just sits waiting for it). Could you run
journalctl -u mysql and see what the output is?
[4 Aug 2016 11:52] Lars Tangvald
Oh wait, I think I see the issue:

There's a bug in 5.6 (fixed in 5.7) where mysql-client is set as a recommended package for the server, but the systemd script for the server will actually try to use mysqladmin (which is in mysql-client) to check if the server is ready. Since you don't have it installed, the service script hangs.

The recommended package is usually installed automatically, but on Ubuntu 16 there's a native mysql 5.7 package, which is making it skip the 5.6 client package.

In short: Try 
  apt-get install mysql-client=5.6.32-1ubuntu16.04
Then run 
  apt-get install -f
[4 Aug 2016 12:41] Puneet Dhiman
Hi,

You have specified exact version of 5.6 but it will  not work if minor version will changed for example: 5.6.33 will release 

and please mark as bug in xenial you don't mentioned this as bug 

I have fixed this issue with installing 
 
apt-get install mysql-community-client
 
after that

apt-get install mysql-community-server

This will work 

Thanks 

puneet dhiman
[13 Jan 2017 7:44] Lars Tangvald
Duplicate of bug 83046 (MySQL 5.6 not currently supported on Ubuntu Xenial)