Create a runcatalog table in a MySQL test database.

Based on the code sqlcreatedb.C by Sergey Linev

Author: Juan Fernando Jaramillo Botero
This notebook tutorial was automatically generated with ROOTBOOK-izer from the macro found in the ROOT repository on Sunday, October 02, 2022 at 09:38 AM.

In [ ]:
from ROOT import TSQLServer

read in runcatalog table definition

In [ ]:
fp = open("runcatalog.sql", "r")
sql = fp.read()

open connection to MySQL server on localhost

In [ ]:
db = TSQLServer.Connect("mysql://localhost/test", "nobody", "")

create new table (delete old one first if exists)

In [ ]:
res = db.Query("DROP TABLE runcatalog")

res = db.Query(sql)