How do I get MySQL working?

I’m in chapter 16 of the book Agile Web D. with Rails. I
was able to get Apache/Passenger working, but now I’m stuck on MySQL.
When I enter “mysql -u root”, I get the message:
ERROR 2002 (HY000): Can’t connect to local MySQL server through socket
‘/var/run/mysqld/mysqld.sock’

I created the /var/run/mysqld directory and the /var/run/mysqld/
mysqld.sock file. However, I was not able to grant ownership of this
file to mysql, because the user mysql doesn’t exist.

What exactly do I need to do?

Hi Jason,

Is your MySQL service running? (/etc/init.d/mysql start or ‘service
mysql
start’)

If all else fails, you may want to consider uninstalling and
reinstalling
your mysql package with your distro’s package manager.

David

On Sun, Oct 2, 2011 at 9:33 AM, Jason H., Mr. Swift L. <

/etc/init.d/mysql doesn’t exist, and ‘service mysql start’ gives me
the error message “mysql: unrecognized service”.

I’m using Ubuntu 11.04 as my OS. What packages do I need installed?
I already have mysql-client-core-5.1 and mysql-common.

You are missing the obvious:

$ sudo apt-get install mysql-server

:smiley:

HTH
Norbert

2011/10/2 Jason H., Mr. Swift L. [email protected]:

akash d. wrote in post #1128893:

Actually i installed mysql-workbench on ubuntu, unable to start mysql.
Whenever i type service mysql start or service mysqld start, i get "
mysql is unrecognized command".

Actually it means that mysql server is not installed try to re-install
it by this command: sudo apt-get install mysql-server

i did that and my problem resolved, :slight_smile:

Regards,
-Akash

Jason H., Mr. Swift L. wrote in post #1024613:

/etc/init.d/mysql doesn’t exist, and ‘service mysql start’ gives me
the error message “mysql: unrecognized service”.

I’m using Ubuntu 11.04 as my OS. What packages do I need installed?
I already have mysql-client-core-5.1 and mysql-common.

It means that mysql server is not installed. Try to re-install it by
this command: sudo apt-get install mysql-server

And start mysql server: service mysql start

This will resolve your problem… :slight_smile:

Actually i installed mysql-workbench on ubuntu, unable to start mysql.
Whenever i type service mysql start or service mysqld start, i get "
mysql is unrecognized command".

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs