Can't start MySQL5.5 on Ubuntu 12.04 - “dpkg: dependency problems”

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-30 01:45:09
Ihsan Kusasi

I found solution with this step:

WARNING: the following step will DELETE your existing data! please backup first!!!

$ sudo apt-get --yes autoremove --purge mysql-server-5.5

$ sudo apt-get --yes autoremove --purge mysql-client-5.5

$ sudo apt-get --yes autoremove --purge mysql-common

$ sudo rm -rf /var/lib/mysql /etc/mysql ~/.mysql



$ sudo deluser mysql

$ sudo apt-get autoclean

$ sudo apt-get update && sudo apt-get upgrade

$ sudo apt-get install mysql-server-5.5 mysql-client-5.5

NOTE: when you get 'dpkg: error...' please run step below:

$ sudo dpkg --configure -a

good luck!

The fix from the Ubuntu forums:

This is what worked for me, though I was doing an install and not an upgrade, so I didn't care about the existing database.

I removed all the mysql application again, then I went and deleted my /var/lib/mysql directory. Keep in mind, if you have an existing database there, you will lose it. You might want to move it to another location.

After removing that directory, I installed again and it worked perfect. So something in the /var/lib/mysql directory was my problem. See if that works for you.

Ilya Obukhov

Had same problem, tried to install with aptitude and discover that error

Setting up mysql-server-5.5 (5.5.41-0ubuntu0.14.04.1) ...
/var/lib/dpkg/info/mysql-server-5.5.postinst: line 146: logger: command not found
ATTENTION: An error has occured. More info is in the syslog!
/var/lib/dpkg/info/mysql-server-5.5.postinst: line 236: logger: command not found
dpkg: error processing package mysql-server-5.5 (--configure):
 subprocess installed post-installation script returned error exit status 127

after installing bsdutils,

apt-get install bsdutils

mysql installation passed normally

Frank Hayward

Make sure that

auto lo                          
iface lo inet loopback

still exists in your /etc/network/interfaces

Just want to add my 5 cents. It may help someone else.

After hunting for and trying various solutions, without the drastic uninstall and purge, my solution was ridiculously simple.

My disk was full! I can't believe I didn't check that first. Cleared it out and hey presto!

I tried everything above, but it still wouldn't install. I finally got it working with this post: http://www.randomhacks.co.uk/mysql-job-failed-to-start-unable-to-set-root-password-cant-find-file-mysql/

It advises to remove folders similar to what was stated above, and also to run

dpkg --get-selections | grep mysql
sudo apt-get remove --purge [everything that came up]
sudo apt-get autoremove && sudo apt-get autoclean
sudo apt-get install mysql-server

I couldnt solve this problem with purging / manual deletion / anything that mysql / ubuntu forums advised me to do

instead, the solution for me was :

1) increase the memory of the VM that Ubuntu was running on

2) after checking /var/log/mysql/error.log, I found out that a specific file couldnt be created at /tmp :

Can't create/write to file '/tmp/ibeDIRhT' (Errcode: 13) InnoDB: Error: unable to create temporary file; errno: 13

I just chmod(ed) /tmp to allow this.

Lo and behold, next attempt of installing mysql was successful.

just in case anyone ever has this problem, purging isn't always the solution, you should check the log to see what error message you have. That might help

Taras Cherrniy

wget http://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-apt-config_0.2.1-1ubuntu14.04_all.deb

dpkg -i mysql-apt-config_0.2.1-1ubuntu14.04_all.deb

apt-get update

apt-get install mysql-server 
razzak

I wasted many hours trying to fix this and in the end it turned out that it just needed full permissions on /tmp directory (i tried 755 and 766 but didn't work, only 777 works), so i ran:

sudo chmod 1777 /tmp

"the number 1 before 777 is called the sticky bit and it adds extra security to the folder, check this for more details about the sticky bit".

and reconfigured:

sudo dpkg --configure mysql-server-5.5

and mysql server started successfully.

MrSatan

I had this problem many times. I can add an other piece of solution for this jigsaw...

WARNING: the following steps will delete your data! Do a backup first!

You have to:

rm -rf /var/lib/mysql rm -rf /etc/mysql

AND

Verify that, the interface "lo" is up and, the traffic is allowed on "lo" (iptables).

Hope that help someone else !

This error also happened when switching from MySQL to MariaDB (https://bugs.launchpad.net/ubuntu/+source/mysql-5.7/+bug/1490071).

The MySQL binary data files were not compatible with MariaDB so I switched back to MySQL because I did not have time to mess with mysqldump.

First I had to move MariaDB data away from /var/lib/mysql, then install MySQL and then move my original data from /var/lib/mysql-5.7 (this backup was automatically created before the error) to /var/lib/mysql.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!