MySQL ERROR on CentOS 7
Hello,
I am trying to create databases using mysql on centOS 7, after typing the command mysql -u root, I got the following error: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2). NB: One of the solutions I found after internet searches which did not work was to create the file /var/lib/mysql/mysql.sock and change the owner to mysql user, I got the error: user mysql does not exist. |
Could you confirm that you installed the server package, not just the client, that the service is running using
Code:
systemctl status mariadb And that you have it enabled to run at system startup please. |
systemctl status mariadb says mariadb is not running and systemctl start mariadb does not start it even though rpm -qa | grep mariadb shows that it is installed. Not sure why this is happening.
|
Quote:
By the way, Mysql or Mariadb? |
Thanks guys I have been able to get mysql running by following the installation steps I just found here https://devops.profitbricks.com/tuto...l-on-centos-7/
Now mysql -u root takes me to the mysql configuration prompt. |
No worries.
Just remember if you just install mariadb that will install client side only. You need to specify mariadb-server. Follow that for the php extensions etc you need too. Just be aware that the official database for centos is mariadb, not mysql. Not sure how well mysql would be integrated in terms of selinux and such. Anyhow, Have fun. |
Thanks ericson007.
|
All times are GMT -5. The time now is 12:14 PM. |