Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have a fresh installation of Ubuntu 11.04. Since I want to work with a MySQL server on this machine I see, that if I enter mys in the terminal and hit TAB it completes to mysql. But if I do mysql -u it says

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

I thought "maybe I have to start the server first", so I tryed

/etc/init.d/mysql

Unfortunately bash tells me

bash: /etc/init.d/mysql: No such file or directory

If I do locate mysql I get a whole bunch of directories and files with mysql in it. So it raises the question: Is MySQL pre-installed on Ubuntu 11.04 or do I have to install it manually? And if it is already installed, how do I configure/start the server, since the way I know how to start a MySQL server on Ubuntu /etc/init.d/mysql doesn't seem to work?

I got the feeling that I miss something and I'll be glad if someone could give me a hint.

Thanks!!

share|improve this question
    
you probably have mysql client installed. –  barraponto Jun 26 '11 at 14:35
add comment

1 Answer 1

up vote 7 down vote accepted

The package that needs to be installed for the MySQL server is named mysql-server. If /etc/init.d/mysql does not exist, the MySQL server is not installed. After installing it using sudo apt-get install mysql-server, it will be started automatically (after the installation and on startup).

Ubuntu has migrated from traditional initscripts to Upstart. If you run /etc/init.d/mysql [action] you'll get a notice.

To stop MySQL, run:

sudo stop mysql

To start it:

sudo start mysql
share|improve this answer
    
Thank you very much, that did the job! –  Aufwind Jun 5 '11 at 10:35
add comment

Your Answer

 
discard

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.