Today we will learn how to set up the Mysql database in our shared hosting Cpanel. I am using them here Namecheap you can use any of them. There are several steps you have to follow. Read them carefully and follow them you can easily do that.

First of all, go to the terminal with your project-specific virtualenv . See how to set up virtualenv in the Django project for Cpanel hosting here and follow the Mysql database setup. Then in the next steps install this package specify here.


##)Create New Database

 

##)Give  Database Name

Here you need to put your database name and click Create Database

##)MySQL Users Add New User


fillup the MySQL Users Add New User form and click Create User


##)Add User To Database


After that, you need to checkmark the correct username and database name you just created in the previous step and hit Add.


##)Manage User Privileges


Then checkmark ALL PRIVILEGES and click make the change.

1. Mysql database installation

 pip install pymysql


2. After that we need to install mysqlclient

pip install mysqlclient


There is a valid reason that your installation will get an error. unable to execute '/usr/bin/gcc':Permission denied.Follow this to slove that. After that follow our tutorial again
    
**Mysql database client installation keep in mind that the latest version of mysqlclient will not work properly. After lots of investigation I
found mysqlclient==2.1.0 is working properly.So install mysqlclient==2.1.0 .

pip install mysqlclient==2.1.0


3. After that we need to configure our database setup in our setting.py file. Just copy this below code and change the database name to your created database name the database username to your previously created username and change the password to your own database password. Keep host, port and engine as it is.

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': 'database name ',
        'USER': 'database username ',
        'PASSWORD': 'database password',
        'HOST': 'localhost',
        'PORT': '3306',
    }
}

5. After completion of the previous steps your setup is complete you are good for the final steps.

python manage.py makemigrations
python manage.py migrate
python manage.py createsuperuser

 

And that's it you are ready to go with this setup. Your database connection is ready you can work with it.

Learn How to deploy django application in shared hosting

Learn How to solve: unable to execute '/usr/bin/gcc':Permission denied in Namecheap

Learn How to develop a full stack development project from planning to coding

 

hosenmdaltaf

Hosen MD Altaf

Hello! I'm Hosen MD Altaf, a passionate Software Engineer and content writer.Who's experienced in taking fullstack applications from scratch to production.Currently, I am working with python and javaScript based FullStack Web development. Over the last 2 years, I've had the opportunity to develop web applications for a handful of awesome companies / clients as a consultant and continue to do so today. My work includes developing fullstack web apps, creating backend servers,designing font-end application, small Big-data and data science projects,creating websites with python django,react.js and wordpress.I am eager to learn kew technologies and looking for new opportunitys.

Comments (12)

wave
  • John Doe

    Nannie Dugan

    April 25, 2024, 2:26 a.m.

    Hi, Do you have a digital product you would like to see promoted for free? Do you target companies with your product? We promote your product for you on a commission basis. Come check us out: https://coderscaffe.leadsboy.biz

    Reply
  • John Doe

    Hilda Hamel

    April 23, 2024, 10:01 p.m.

    Hi, If I can tell you exactly which Businesses (B2B) visited your website today - would you be interested? Here is what I mean. You get 100 visitors today. 2 of them fill out your form. 1 of them calls you. 97 of them are gone forever... Until Now. Our software can track: -Who was on your website -How they got there -What keyword they searched -Their Name, Phone and Email address. Don't lose any more leads or sales opportunities. We've been in business since 2015 with clients around the world. Interested? Send me your name and number for a no cost demo on YOUR website. LeadsMax.biz Regards, Website Detective Don't Miss Any Opportunity.

    Reply
  • John Doe

    Tony

    April 21, 2024, 9:11 p.m.

    Greetings, I'm Tony, a skilled English SEO copywriter and content writer. My expertise lies in creating engaging blogs, articles, e-commerce product descriptions, SEO content, website content, business service descriptions, newsletter content, brochures, proofreading, social media captions, LinkedIn content, and SOPs. My pricing is USD 40 per 1000 words of content. If you're short on time to strategize your content, we can assist you with that. Feel free to reach out via email at Contentwriting011994@outlook.com for any ongoing needs. Best regards, Tony

    Reply
  • John Doe

    Lavon Westbury

    April 19, 2024, 3:08 p.m.

    Hi, Do you have a digital product you would like to see? Do you target companies? We promote your product for you on a commission basis. Come check us out: https://coderscaffe.leadsboy.biz

    Reply
  • John Doe

    Latesha Parrish

    April 19, 2024, 5:43 a.m.

    Hi, I hope this email finds you well. I wanted to reach out to you today to discuss logo products and apparel for your business. Quick question: Who would be the best contact to discuss your company logo products and apparel such as: -Printed T-shirts -Logo mugs -Branded water bottles -Custom USB flash drives -Logo pens -plus 300,000 other products for your business https://coderscaffe.marketingeee.com/ With over two decades of experience in the promotional products industry, our company is dedicated to helping businesses like yours leave a lasting impression. Our wide range of custom-branded merchandise is designed to elevate your brand, foster customer loyalty, and drive sales. From captivating trade show giveaways to thoughtful employee incentive programs and impressive corporate gifts, we have the expertise to create unique promotional items tailored to your specific needs. Our team of promo product specialists will guide you through the entire process, from selecting the perfect items for your business to designing and creating custom logos that speak to your brand identity. As your one-stop-shop for branded merchandise, we ensure top-quality finished products are delivered right to your doorstep, making the process seamless and hassle-free. Let's connect and explore how our promotional products can enhance your brand awareness and fuel business growth. Thank you for your time, and we look forward to hearing from you soon. Best regards, Creative Specialist Branded Products https://coderscaffe.marketingeee.com/

    Reply
  • John Doe

    Gabriele Burne

    April 17, 2024, 2:30 a.m.

    Hello, We noticed your domain: coderscaffe.com is listed in very few directories. Directories have a very high Page Rank Score and provide really good back links Company visit us on Company Registar and list your domain in all the directories. https://coderscaffe.companyregistar.org/coderscaffe.com

    Reply
  • John Doe

    Rana

    April 5, 2024, 4:32 a.m.

    Hi, This is Rana. I'm reaching out to offer my expertise in social media management, including strategic calendar planning, captivating post creation as per your business, e-commerce product promotion, SEO-friendly social media captions, and design services such as brochures, posters, and flyers tailored to enhance your brand's social media presence and engage your audience effectively. My rate is USD 20 per hour. I can provide you a fixed quote as per your requirements. Drop me an email at socialmedia1145@outlook.com to discuss it further.

    Reply
  • John Doe

    Cedric Slowik

    March 28, 2024, 9:18 a.m.

    We have hacked your website https://coderscaffe.com and extracted your databases. How did this happen? Our team has found a vulnerability within your site that we were able to exploit. After finding the vulnerability we were able to get your database credentials and extract your entire database and move the information to an offshore server. What does this mean? We will systematically go through a series of steps of totally damaging your reputation. First your database will be leaked or sold to the highest bidder which they will use with whatever their intentions are. Next if there are e-mails found they will be e-mailed that their information has been sold or leaked and your site https://coderscaffe.com was at fault thusly damaging your reputation and having angry customers/associates with whatever angry customers/associates do. Lastly any links that you have indexed in the search engines will be de-indexed based off of blackhat techniques that we used in the past to de-index Our targets. How do i stop this? We are willing to refrain from destroying your site's reputation for a small fee. The current fee is $3000 in bitcoins (0.044 BTC). Send the bitcoin to the following Bitcoin address (Make sure to copy and paste): 34fhmb7BUFfrdvhdxfPZ6u3LMFG8fQ3NKo Once you have paid we will automatically get informed that it was your payment. Please note that you have to make payment within 5 days after receiving this e-mail or the database leak, e-mails dispatched, and de-index of your site WiLL start! How do i get Bitcoins? You can easily buy bitcoins via several websites or even offline from a Bitcoin-ATM. What if i don't pay? We will start the attack at the indicated date and uphold it until you do, there's no counter measure to this, you will Only end up wasting more money trying to find a solution. We will completely destroy your reputation amongst google and your customers. This is not a hoax, do not reply to this email, don't try to reason or negotiate, we will not read any replies. Once you have paid we will stop what we were doing and you will never hear from us again! Please note that Bitcoin is anonymous and no one will find out that you have complied.

    Reply
  • John Doe

    Abi

    March 26, 2024, 1:07 p.m.

    Hello, I'm Abi, an English SEO copywriter and content writer. I excel in crafting blogs, articles, e-commerce product descriptions, SEO content, website content, business service descriptions, newsletter content, brochures, proofreading, social media captions, LinkedIn content, and SOPs. My rate is USD 40 for every 1000 words of content. If you don't have time to plan out your content, we can help you with that. Feel free to email me at Contentwriting011994@outlook.com with any current requirements. Thanks, Abi

    Reply
  • John Doe

    Nadine Lam

    March 25, 2024, 5:55 p.m.

    Hi, Want thousands of clients? We have compiled a list of all consumers and business's across 149 countries for you. We have a special that is running today and valid till the end of the day. Come check us out: https://coderscaffe.leadsmax.biz/ Consumer Records: 294,582,351 Business Records: 25,215,278 Selling at $99 today only.

    Reply
  • John Doe

    Amelia Brown

    March 21, 2024, 2:59 a.m.

    Hi there, We run a YouTube growth service, which increases your number of subscribers both safely and practically. - We guarantee to gain you 700-1500+ subscribers per month. - People subscribe because they are interested in your channel/videos, increasing likes, comments and interaction. - All actions are made manually by our team. We do not use any 'bots'. The price is just $60 (USD) per month, and we can start immediately. If you have any questions, let me know, and we can discuss further. Kind Regards, Amelia

    Reply
  • John Doe

    Abi

    March 2, 2024, 12:35 a.m.

    Hello, I'm Abi, an English SEO copywriter and content writer. I excel in crafting blogs, articles, e-commerce product descriptions, SEO content, website content, business service descriptions, newsletter content, brochures, proofreading, social media captions, LinkedIn content, and SOPs. My rate is USD 40 for every 1000 words of content. If you don't have time to plan out your content, we can help you with that. Feel free to email me at Contentwriting011994@outlook.com with any current requirements. Thanks, Abi

    Reply

Leave Comment

wave