How do I get MySQL working?

32 views
Skip to first unread message

Jason Hsu, Mr. Swift Linux

unread,
Oct 1, 2011, 9:33:59 PM10/1/11
to Ruby on Rails: Talk
I'm in chapter 16 of the book _Agile Web Development 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?

David Chua

unread,
Oct 1, 2011, 10:17:01 PM10/1/11
to rubyonra...@googlegroups.com
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



--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonra...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.


Jason Hsu, Mr. Swift Linux

unread,
Oct 2, 2011, 1:07:48 AM10/2/11
to Ruby on Rails: Talk
/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.

Norbert Melzer

unread,
Oct 2, 2011, 1:11:24 AM10/2/11
to rubyonra...@googlegroups.com
You are missing the obvious:

$ sudo apt-get install mysql-server

:D

HTH
Norbert

2011/10/2 Jason Hsu, Mr. Swift Linux <jhsu8...@gmail.com>:

akash d.

unread,
Nov 28, 2013, 11:28:22 AM11/28/13
to rubyonra...@googlegroups.com
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".

--
Posted via http://www.ruby-forum.com/.

akash d.

unread,
Nov 28, 2013, 11:33:33 AM11/28/13
to rubyonra...@googlegroups.com
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, :)


Regards,
-Akash

akash d.

unread,
Nov 28, 2013, 11:35:48 AM11/28/13
to rubyonra...@googlegroups.com
Jason Hsu, Mr. Swift Linux wrote in post #1024613:
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.. :)
Reply all
Reply to author
Forward
0 new messages