I\'m attempting to use mysql after only having worked with sqlite in the past.
I\'ve installed XAMPP
on Linux (ubuntu) and have mysql
up and ru
Have the same issue using and look for your SQL configuration file my.cnf.
# The following options will be passed to all MySQL clients
[client]
#password = your_password
port = 3306
socket = /Applications/XAMPP/xamppfiles/var/mysql/mysql.sock
and use socket as parameter:
mysql://read:read@localhost/phonehome?unix_socket=/Applications/XAMPP/xamppfiles/var/mysql/mysql.sock
In my case:
app.config['SQLALCHEMY_DATABASE_URI'] = 'mysql://read:read@localhost/phonehome?unix_socket=/Applications/XAMPP/xamppfiles/var/mysql/mysql.sock'
For the record (and thanks to a pointer from Igancio), I found that the below works (terrible I didn't think of this before):
db=MySQLdb.connect(
user="root"
,passwd=""
,db="my_db"
,unix_socket="/opt/lampp/var/mysql/mysql.sock")
It means that you didn't start the MySQL server, or it's configured to not use a domain socket.