There are literally tons of answers, which involve installing mysql-server
in ubuntu. But I am using XAMPP and I am able to access mysql server through browser. I want the convenience of both PHPmyadmin and xampp and running flask app from terminal. For some reason, it is giving me the error Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock
.
I am extremely new to ubuntu and I will grateful if someone tells me how to link xampp mysql server to ubuntu terminal. I simply could not find an answer for this particular answer. My mysql.sock
file is in /opt/lammp/var/mysql/
folder, if that helps.
Any help regarding this really appreciated.
EDIT: I have added the following lines my /etc/mysql/my.cnf
file:
[mysqld]
socket=/opt/lampp/var/mysql/mysql.sock
[client]
socket=/opt/lampp/var/mysql/mysql.sock
But the error message is not changing.
EDIT: This error seems to be only occurring in flask application with the library flask-mysqldb
. mysql-connector
in python is functioning as expected.