This works. db=MySQLdb.connect(user='root') cur =db.cursor() cur.execute('CREATE DATABASE testdb')
On Jun 15, 9:20 pm, Jean-Guy <jean...@gmail.com> wrote: > On 2010-06-15 17:01, Phyo Arkar wrote: > > > i meant Databases, i know it creates Tables. > > > db=DAL('mysql://username:passw...@localhost/test' ) #means you have a > > database named test > > > In my case , Database is non-existance , well a user input name of > > database to create , lets say testdb and it creates. > > > On Jun 15, 7:55 pm, Jean-Guy<jean...@gmail.com> wrote: > > >> On 2010-06-15 15:03, Phyo Arkar wrote:> ot sure how DAL of Web2py can > >> create DBs. I think we have to > > >>> use python-mysql to do the work? > > >> When you define a model web2py create the database for you!! > > >> You have to tell wich RDBMS you use... > > >> db=DAL<http://web2py.com/book/default/docstring/DAL>('sqlite://storage.sqlite') > > >> For you : > > >> 'mysql://username:passw...@localhost/test' > > >>http://web2py.com/book/default/section/6/2?search=mysql > > >> Jonhy > > No you have to create manually the empty database in mysql. > > Maybe I didn't understand what you were expecting. > > Jonhy