Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2013
    Posts
    23

    Unanswered: Using Pythom to Commit

    Hello -

    This is a Python related ques but quite basic to creating tables, inserting data. So thought maybe can post it here.
    ...
    I am having a weird problem with MySQL. I am new to MySQL but not to RDBMS.

    I am using Python (python.mysql connector from Oracle).

    I am executing scripts, using Python, to drop / create tables, indexes, views and inserting initializing data. All in a sequence of calls from a Python script.

    The scripts all execute fine - tables indexes, fk, views all get created from Python. Then the init scripts are run from Python, COMMIT is executed, NO errors.

    I have error handlers that would report the errors as well.

    ...
    However, when I log into MySQL I see tables, indexes, views - everything - but when I do a select to see the data (10 rows worth), there is no data.

    If I run the INIT scripts directly in MySQL (that I ran from within Python), the data is inserted fine and the IDs are from 11 - meaning the 10 rows are there somewhere.

    But I cannot see them.

    I made sure connection settings are fine and all are - after all it creates the tables / indexes / views) - but I see no data.

    ...
    I have run the scripts several times, same thing every time.

    If anyone has any ideas on what may be happening would really appreciate your help.

    Any DBA commands I need to run to check settings, I would be happy to and would be much appreciated as well.

    Thank you.

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    First off id suggest using thr python connector for mysql, unless thata a typo
    Prove you have data by viewing it through something other than python.
    You should be able to do that through the mysql command line client, failing that try mysqls workbench or another tool such as heidisql
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Jun 2013
    Posts
    23
    I am connecting into MySQL through the terminal (I am on Ubuntu) and running commans.

    I see tables, indexes, fks and such - no data.

    I am using Python MySQL connector - yes it is by Oracle. Don't understand what you mean by typo.

    Thank you.

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    sorry my bad I saw Oracle and forgot that Oracle now provid the connector for MySQL

    so you are saying the schema exists but that there is no data actually in the table...
    as most is working then its more likely this is a python problem NOT a MySQL problem, so you are going to have to hope there is someone knowledgeable with Python talking to MySQL.

    were there any errors on attempting to write the data?
    I'd rather be riding on the Tiger 800 or the Norton

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •