Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- # 1. create file install.py inside of this directory with .sql files
- # 2. place it inside of file (adjust dbname dbuser and dbpass)
- # 3. run python install.py
- from os import listdir
- from os.path import isfile, join
- from os import system
- mypath = "."
- dbname = "comp1482bb"
- dbuser = "wpml"
- dbpass = "wpml"
- onlyfiles = [f for f in listdir(mypath) if isfile(join(mypath, f))]
- for f in onlyfiles:
- if f[-4:] == ".sql":
- system("mysql -u "+dbuser+" -p"+dbpass+" "+dbname+" < "+f)
- print "File "+f+" imported"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement