Database setup

16 views
Skip to first unread message

Soumen Khatua

unread,
Apr 20, 2019, 4:22:05 AM4/20/19
to django...@googlegroups.com
Hi Folks,
How can I configure xampp server provided mysql database in django.

Thank you.  

Okware Aldo

unread,
Apr 20, 2019, 5:19:49 AM4/20/19
to django...@googlegroups.com
Hey, If you have xampp installed, just create a database using phpmyadmin, attach a user to that database. 
then ensure you have a driver package installed and setup for django. eg. pymsql has worked well for. 
then make the necessary changes in django settings file. 


--
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/CAPUw6WZXNhKtx4zkUk-tqjSTvfBU%2BhFKuzqXG-UzHmDzT9iZyg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Soumen Khatua

unread,
Apr 20, 2019, 5:59:20 AM4/20/19
to django...@googlegroups.com
Yes I already install xampp server but what will be my password? Actually for development purpose xampp server not accept any password, I guess!!


Thank you for your valuable time. 

Okware Aldo

unread,
Apr 20, 2019, 6:40:14 AM4/20/19
to django...@googlegroups.com
So if you launch xampp and you are sure all the services are running. services (Apache, MySQL, and PHP), xampp also ships with phpmyadmin a mysql webbased interface. which you can launch by typing `localhost/phpmyadmin` in any browser of choice. 

Once the PHPMyAdmin interface is launched. using this tool you can create a MySQL DB, create a user with password and attach the user to that database

if you have a database already you could use the default root user for MySQL, there is usually no password. so you username: root and password would be blank, I don't recommend this, it's not a good practice. 


Sipum

unread,
Apr 23, 2019, 4:35:09 AM4/23/19
to Django users
Hi somen,

Just Open xampp control panel and run apache and mySQL sever.
then go to localhost/phpmyadmin in browser and there create a database as u do for php.

then in search DATABASE in settings.py file (which would be created when u create a project in django) do the below changes -
 
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'webapp',         --> name of db which u created b4
        'USER': 'root',                --> user is root 
        'PASSWORD': '',           ----> it is pasword less
        'HOST': '127.0.0.1',        ---> this is for local host
        'PORT': '3306',               ----> this port number u will get from xampp control panel where u start MYSQL
}


Hope it will help... Njoy
Reply all
Reply to author
Forward
0 new messages