0

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.

Community
  • 1
  • 1
Sandrocottus
  • 521
  • 3
  • 8
  • 31
  • 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 Mar 16 '16 at 09:40
  • 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 Mar 16 '16 at 09:50
  • 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 Mar 16 '16 at 09:51
  • The log file is empty. – Sandrocottus Mar 16 '16 at 09:55
  • you need to find your own log file location, maybe different path. – Dylan Su Mar 16 '16 at 09:56
  • sorry, the error.log file was in /var/log/mysql. – Sandrocottus Mar 16 '16 at 10:02
  • Does this answer your question? [OperationalError: (2002, "Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)")](https://stackoverflow.com/questions/18150858/operationalerror-2002-cant-connect-to-local-mysql-server-through-socket-v) – Terchila Marian Feb 17 '20 at 05:30

1 Answers1

0

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.

Community
  • 1
  • 1
Sandrocottus
  • 521
  • 3
  • 8
  • 31