Visit Counter

Monday, June 1, 2020

Can't connect to local MySQL server through socket

Oracle VM
Mysql 8
=======

I installed MySQL server 8 using yum...but I start MySQL server getting below error.


Can't connect to local MySQL server through socket


root@rac01 ~]# mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
[root@rac01 ~]# service mysqld start
Initializing MySQL database:                               [  OK  ]
Starting mysqld:                                                    [  OK  ]
[root@rac01 ~]#
[root@rac01 ~]# mysql
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

[root@rac01 ~]# mysql -u root -p
passwd:


mysql>


Refer:

https://tableplus.com/blog/2018/08/solved-cant-connect-to-local-mysql-server-through-socket.html