0
votes

I am trying to use MySQL on a 32-bit Linux Mint machine. There are multiple questions regarding this issue, but i couldn't find a solution anywhere in-spite of trying multiple solutions. I even re-installed MySQL, but still gives me error.

Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (38) suggests to change permissions of the folder, but that didn't help. I tried restarting MySQL, but the error still persists.

error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)' suggests to find sockets using sudo find / -type s and expects to find socket=/var/lib/mysql/mysql.sock and add this to my.cnf file. But i couldn't find the socket after executing the find command.

In my my.cnf file, 'socket=/var/run/mysqld/mysqld.sock'. But i couldn't find the file mysqld.sock in either /var/run/mysqld or /var/lib/mysql.

How do i get MySQL working ??

Edit:- I executed ps -el | grep mysqld to check if the server is running and i can see the one mysqld process running.

1
Your question is terribly vague. If you install the MySQL package provided by the distribution you shouldn't need to tweak file permissions manually (that's what package managers are for) so... Did you install MySQL for sources or what? Also, the most obvious reason to not be able to connect is that the server is not started but you don't even mention if that's the case.Álvaro González
I edited my question to mention that server is running. I changed the file permissions as i read it as a marked answer on one of the post. I installed MySQL from the community.linuxmint.com.Sandrocottus
check your log file like vi /var/log/mysqld.log. I encounter a similar issue before with InnoDB: Error: log file ./ib_logfile1 is of different size 0 50331648 bytes in log file. in this case, handle this problem.Dylan Su
The log file is empty.Sandrocottus
you need to find your own log file location, maybe different path.Dylan Su

1 Answers

0
votes

Well this was silly, but frustrating though!!

The problem actually lie in misspelling INNODB the my.cnf file. The document i was referring to, misspelled the database name as INNOD instead of INNODB in the diagram.

enter image description here

Changing this in the my.cnf sorted out the issue.

I admit my mistake of blindly typing and not verifying. Thank you https://stackoverflow.com/users/5875887/dylan-sufor pointing in right direction.