0 votes
1 view
by (19.2k points)

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

[[email protected] tpdatabase-]# 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-]# 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.6k 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 !