Monday, December 18, 2017

Django 2.0 and MySql

I am trying this in a VM with ubuntu 16.04:

bash Miniconda3-latest-Linux-x86_64.sh
sudo apt-get install rabbitmq-server
sudo systemctl start rabbitmq-server
pip install Django celery PyMySQL
sudo apt-get install mysql-server
mysql_secure_installation
mysql -u root -p
mysql> CREATE USER 'acpype_mysql'@'localhost' IDENTIFIED BY '_bla_bla_';
mysql> GRANT ALL PRIVILEGES ON * . * TO 'acpype_mysql'@'localhost';
conda install -c bioconda mysqlclient

And once I have copied my django project, I try:

python manage.py makemigrations

which will fail with:

django.db.utils.OperationalError: (2002, "Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)")

from my settings.py

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'acpype_db',
        'USER': 'acpype_mysql',
        'PASSWORD': '_bla_bla_',
        'HOST': 'localhost',
        'PORT': '',
        'HOST': '/tmp/mysql.sock',
    }
}

Many thanks in advance,

Alan
--
I'll cycle across Britain in 2018 for a charity, would you consider
Many thanks!
--
Alan Wilter SOUSA da SILVA, DSc
Senior Bioinformatician, UniProt
European Bioinformatics Institute (EMBL-EBI)
European Molecular Biology Laboratory
Wellcome Trust Genome Campus
Hinxton
Cambridge CB10 1SD
United Kingdom
Tel: +44 (0)1223 494588

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAEznbzm7J8mq-f9n%2BqStPYSqgii1NxgiXTgdN1s56d0vLNaAQw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment