Re: creating a database using python
You just need to connect without the parameter "db".
Then you can execute the "create" query.
You can olso use the query "USE db_name" to say what database you are going to use.
This code works to me:
db=MySQLdb.connect(user='root')
c=db.cursor()
c.execute('CREATE DATABASE pippo')
This is the link with sql manual:
http://dev.mysql.com/doc/refman/5.0/en/sql-syntax.html
The "USE" statement is in "SQL Utility Statements"
Subject
Written By
Posted
November 24, 2008 09:53AM
November 24, 2008 01:28PM
Re: creating a database using python
November 27, 2008 01:25PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.