I've created a virtual machine and am installing things from scratch. Definitely not a sys admin so I'm running into some trouble. I've installed these packages and then restarted httpd
yum -y install mysql
yum -y install php-mysql
yum -y install mysql-devel
service httpd restart
The httpd restart is successful yet I am still getting this error:
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'
I looked at /etc/my.cnf
and indeed, socket
is pointing to that path.
But the /var/lib/mysql
folder does not even exist, nor do some files which seem crucial such as /etc/init.d/mysql
. Am I missing some other important MySQL yum package? Why would some files (such as my.cnf) exist while others don't?
It's likely that you need to install the mysql-server package.
You can search for packages by name with some of the following yum commands:
The packages which you did install likely provided only the client and client libraries, which you could use to connect to a mysql server located on another host.