Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am new to ubuntu and installed MySQL use a rpm file, and started it use sudo start mysql, when i try

mysqladmin -u root password test

I get

mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!

I checked the mysqld folder and there is nothing
what can i do the next? Thanks for your answers

share|improve this question
try this ->… – hhlp Nov 18 '11 at 12:46
up vote 2 down vote accepted

How did you manage to install it using an rpm file??? I'm sure that you're either mistaken or definitely doing something wrong. All you needed to do is

sudo apt-get install mysql-server mysql-client

UPDATE: There seems to be MySQL 5.5 .deb file here (although the repository is for Debian) - at any rate, I think it may work better than an rpm

share|improve this answer
yeah,I've installed use the sudo apt-get install mysql-server mysql-client before, but the MySQL version is 5.1 but I want to install 5.5,so I used alien to convert the rpm file to deb file,then i use sudo dpkg -i mysql-server.deb to install it,and now I google a lot but I just didn't find an answer to solve my problem – yang Nov 18 '11 at 8:00
If you were following something similar to these instructions - - note the use of /usr/bin/mysql_secure_installation at the end – Sergey Nov 18 '11 at 11:16

first do

 sudo mysql_install_db

 sudo mysql_secure_installation

 mysql -u root -p

then enter your password

share|improve this answer
when i try sudo mysql_install_db it says Installing MySQL system tables... /usr/sbin/mysqld: error while loading shared libraries: cannot open shared object file: No such file or directory – yang Nov 19 '11 at 5:32

Ubuntu doesnot use rpm it uses deb. Make sure you have installed mysql i.e.

sudo apt-get install mysql-server

It will prompt for password for root user i.e. password for your mysql root user not your system root user.

After that do

mysql -u root -p

you will be prompted for password and enter your mysql root password one you entered during mysql installation and then you are good to go.

share|improve this answer

There's some information in the MySQL Documentation regarding connection errors. AFAIK you will have to enable access even on localhost by modifying the bind-address config parameter: You will have to set it explicitly to to make MySQL waiting for localhost connections. There config file should be /etc/mysql/my.conf or /etc/mysql/my.cnf

share|improve this answer

Are you logging in from root account ? create a root account by using MYSQL Administrator with debian-sys-maint account whose username and password are present in /etc/mysql/debian.cnf

see if it helps

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.