Back

Explore Courses Blog Tutorials Interview Questions

Explore Tech Questions and Answers

Welcome to Intellipaat Community. Get your technical queries answered by top developers!

0 votes
3 views
by (19.1k points)

I'm trying to access mysql and when I run the mysql command, I get the following.

[[email protected] tpdatabase-1.8.0.28356]# mysql

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

Doing this returns nothing

[[email protected] mysqld]# find -name mysql*

[[email protected] mysqld]# /etc/init.d/mysql stop -bash: /etc/init.d/mysql: No such file or directory

[[email protected] tpdatabase-1.8.0.28356]# mysql_config |grep -- --socket

--socket [/var/lib/mysql/mysql.sock]

Maybe a permissions problem?

I do have mysql installed using yum install mysql

I'm running CentOS 5.4 on an Amazon EC2 Cloud Instance

1 Answer

0 votes
by (44.3k points)

Have to do two steps, First install MySQL server package and then start the service

Step 1:

sudo yum install mysql-server

Step 2:

sudo service mysqld start


 

Welcome to Intellipaat Community. Get your technical queries answered by top developers!

28.4k questions

29.7k answers

500 comments

94k users

Browse Categories

...