0

I tried installing MySQL using

sudo apt-get install mysql-server, and I get an error saying

Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 mysql-server : Depends: mysql-server-5.1 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

When I type sudo apt-get install mysql-server-5.1, it says:

Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 mysql-server-5.1 : Depends: mysql-client-5.1 (>= 5.1.69-0ubuntu0.11.10.1) but it is not going to be installed
                    Depends: libdbi-perl but it is not going to be installed
E: Unable to correct problems, you have held broken packages."

And when I type mysql, it says,

 ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

I tried sudo apt-get remove --purge mysql-client-5.1 but it says that

mysql-client is not installed so it can't be uninstalled.

What should I do?

Braiam
  • 67,791
  • 32
  • 179
  • 269
Chandan
  • 3
  • 1
  • 3

1 Answers1

0

And when I type "mysql", it says, "ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)"

You can login to mysql database through

mysql -u root -p

and not mysql

While installation going you mus get prompted for password and you have to give that password here to login.

and to fix dep issue , you might try with

sudo apt-get install -f
Raja G
  • 102,391
  • 106
  • 255
  • 328