I have a VM running Ubuntu server which I just upgraded to 14.04. The VM provides access to a MySQL database. However, after upgrading, the database refuses to start and I don't know enough about it to figure it out:root@vm-1 ~ $ service mysql startstart: Job failed to startI checked /var/log/mysql/error.log and found:141001 20:23:10 [Note] Server hostname (bind-address): '127.0.0.1'; port: 3306141001 20:23:10 [Note]   - '127.0.0.1' resolves to '127.0.0.1';141001 20:23:10 [Note] Server socket created on IP: '127.0.0.1'.141001 20:23:10 [ERROR] Can't start server : Bind on unix socket: Permission denied141001 20:23:10 [ERROR] Do you already have another mysqld server running on socket: /var/run/mysqld/mysqld.sock ?141001 20:23:10 [ERROR] Aborting141001 20:23:10  InnoDB: Starting shutdown...141001 20:23:11  InnoDB: Shutdown completed; log sequence number 24590151085141001 20:23:11 [Note] /usr/sbin/mysqld: Shutdown completeYou can find the entire contents of the file here. Note that I deleted it just before running the service command shown above so everything there is from a single attempt to start the MySQL service.I also checked the obvious:$ ps ax | grep mysql 3623 pts/1    S+     0:00 grep --color mysql$ rm /var/run/mysqld/mysqld.sockrm: cannot remove /var/run/mysqld/mysqld.sock: No such file or directory$ netstat | grep 3306I made sure the database directory has the right permissions:$ chown -R mysql:root /data/database/I tried running strace but could see nothing obvious. I understand very little of it though, so you can find the output here.Finally, my /etc/mysql/my.cnf is:[client]port        = 3306socket      = /var/run/mysqld/mysqld.sock[mysqld_safe]socket      = /var/run/mysqld/mysqld.socknice        = 0[mysqld]user        = mysqlsocket      = /var/run/mysqld/mysqld.sockport        = 3306basedir     = /usrdatadir     = /data/databasetmpdir      = /tmpskip-external-lockingbind-address        = 127.0.0.1key_buffer      = 16Mmax_allowed_packet  = 16Mthread_stack        = 192Kthread_cache_size       = 8myisam-recover         = BACKUPquery_cache_limit   = 1Mquery_cache_size        = 16Mlog_error                = /var/log/mysql/error.logexpire_logs_days    = 10max_binlog_size         = 100M[mysqldump]quickquote-namesmax_allowed_packet  = 16M[mysql][isamchk]key_buffer      = 16M!includedir /etc/mysql/conf.d/I tried changing the bind-address line above to 0.0.0.0, 127.0.0.0 and 127.0.1.1 (this one because I have a 127.0.1.1   foo line in my /etc/hosts where foo is my VM's hostname) and 10.1.1.213 which is the actual internal IP of the machine on my network. None of them made any difference. I also tried commenting out the bind-address line for good measure and ditto.My system details:$ cat /etc/issueUbuntu 14.04.1 LTS \n \l$ dpkg -s mysql-server | grep versionVersion: 5.5.38-0ubuntu0.14.04.1
Can't start the MySQL service on a recently upgraded VM
mysql;services
The issue was indeed related to apparmor. For some reason, these two lines were commented out in the new /etc/apparmor.d/usr.sbin.mysql file:#  /var/lib/mysql/ r,  #  /var/lib/mysql/** rwk,Uncommenting them fixed the issue. Thanks to @Belrog and @slm who pointed me in the right direction.