Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6561333
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:34:25+00:00 2026-05-25T13:34:25+00:00

Ok first, please assume that this is the first time I will be writing

  • 0

Ok first, please assume that this is the first time I will be writing a single alphabet of code in SQL.. so please please please… it would be very kind if you can explain me each step. 🙂
I am using mac for this development.
So in the desktop, I have a huge (1.5GB) dumpfile of a database.
I have mysqlworkbench (yes I have never worked in that either 🙁 )
And I have installed MySQLdb.
So, basically what I want to do is use the data in the database from python.
So I have python.. mysqldb to connect to db.. huge db and mysqlworkbench..
Now I assume, that this dumpfile is useless as its not in form of database..
so how do I “mount” this dump to a database..(mysqlworkbench)
After that how do I query from python..
(like the port number.. username , password!! ? )
It would be of huge help if anyone can help me.. I have been stuck in this since morning.. 🙁

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T13:34:25+00:00Added an answer on May 25, 2026 at 1:34 pm

    In order to use the data in the file, it needs to be imported into the database. (Think of the file as a recipe for MySQL to make a database. Now you need to tell MySQL to make the database from the recipe).

    You can import the database using command line, a python script or even MySQL workbench. However, due to the size of the file, using MySQL workbench could be a problem (Note: I am not familiar with MySQL workbench).

    To import the database with the command line use the command:

    mysql -u <username> -p -h localhost king_tracking < <filename>
    

    To actually use the database with python, there are several step by step tutorials available, easily accessible from a google search. A basic script is (from here)

    import MySQLdb
    
    conn = MySQLdb.connect (host = "localhost",
                           user = "testuser",
                           passwd = "testpass",
                           db = "test")
    cursor = conn.cursor ()
    cursor.execute ("SELECT VERSION()")
    row = cursor.fetchone ()
    print "server version:", row[0]
    cursor.close ()
    conn.close ()
    

    This just shows the version of MySQL, however if

    "SELECT VERSION()"
    

    is replaced by your own query, like

    "SELECT * FROM <tablename> LIMIT 0,30"
    

    you can execute your own queries.

    In order to understand the tutorials on interfacing python and MySQL, you should be familiar with both separately. A good SQL tutorial is the one at W3schools.


    The problem with creating a table is separate from the original question, but may need to be addressed before trying to import the file into the database.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is my first time playing with both ajax and objects, so please go
this is my first time to work with API's in PHP, so please bear
This will be my first time creating one of those slider things. I've seen
Please assume that I do not need to worry about development time and costs:
This is my first question so please be patient :) Background: I'm implementing an
First question on here so please be nice :) I know very little about
First time Stack Overflow poster. Please bear with me! :) I have a set
first time poster and TDD adopter. :-) I'll be a bit verbose so please
This is my first post on Stack, so please bear with me if I
OK, so I'm working with a little regular expression—it's my first time, please, be

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.