Poll Tutorial: I'm stuck I have mysql on my vps I created the database

27 views
Skip to first unread message

RETAIL CYBER

unread,
Jan 22, 2019, 11:57:51 AM1/22/19
to Django users
all tutorials ive seen is in the view of someone doing it on a home pc
how can i connect to mysql thats already on my vps server. its with centos linx


im following this tutorial


what I altered below:


DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'urbanpyt_polls',
        'USER': 'urbanpyt_dbz',
        'PASSWORD': 'shawn316613'
        'HOST': 'localhost',
        'port': '',
    }
}

RETAIL CYBER

unread,
Jan 23, 2019, 1:57:40 AM1/23/19
to Django users
has anyone ever install the django on a live web hosting service? if so when it comes to using db is the db virtual just like djangoEnv or do i use the mysql thats on my host? i have a vsp??

Anirudh Jain

unread,
Jan 23, 2019, 2:29:38 AM1/23/19
to django...@googlegroups.com
First of all you can remove 'PORT'. Then the most important thing to do is to grant your user privileges to perform operations on mysql database that you must have created by the name 'urbanpyt_polls'. The easiest way to do is to run this query on mysql : GRANT ALL PRIVILEGES ON *.* TO 'username'@'localhost' IDENTIFIED BY 'password';
You only need to replace 'username' by your user and similarly the password.
After this - python manage.py makemigrations and then migrate

On Wed, Jan 23, 2019 at 12:28 PM RETAIL CYBER <shawn...@gmail.com> wrote:
has anyone ever install the django on a live web hosting service? if so when it comes to using db is the db virtual just like djangoEnv or do i use the mysql thats on my host? i have a vsp??

--
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...@googlegroups.com.
To post to this group, send email to django...@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/fb36ebb9-ad3c-448a-a290-2fac0f7cd345%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Anirudh Jain | Appreciate you taking time to read the mail.

Motaz Hejaze

unread,
Jan 23, 2019, 12:49:35 PM1/23/19
to django...@googlegroups.com
really your question is not clear , 
what is the error message you got from debugger ??


Reply all
Reply to author
Forward
0 new messages