1 Answer
First You need to Find a path of socket inside the /etc/my.cnf file.
For ex: /var/lib/mysql/mysql.sock
Just remove the file if it already exist /var/lib/mysql/mysql.sock
Now newly Create a file named as mysql.sock in /var/lib/mysql/
set the ownership and permission as shown below
chown mysql.root mysql.sock
chmod 775 mysql.sock
Restart the service use the command as follow service mysqld start
Then you can set or reset the password of root user in mysql
mysql_secure_installation
Just press enter while asking the default root password of mysql
Then you can proceed with set the new password and user privileges to accessing the mysql
Your Answer
x