aboutsummaryrefslogtreecommitdiff
path: root/rpkid/portal-gui/scripts/rpkigui-setup-sql.py
diff options
context:
space:
mode:
Diffstat (limited to 'rpkid/portal-gui/scripts/rpkigui-setup-sql.py')
-rw-r--r--rpkid/portal-gui/scripts/rpkigui-setup-sql.py29
1 files changed, 0 insertions, 29 deletions
diff --git a/rpkid/portal-gui/scripts/rpkigui-setup-sql.py b/rpkid/portal-gui/scripts/rpkigui-setup-sql.py
deleted file mode 100644
index 2d3c1833..00000000
--- a/rpkid/portal-gui/scripts/rpkigui-setup-sql.py
+++ /dev/null
@@ -1,29 +0,0 @@
-# $Id$
-#
-# This script is responsible for creating the database used by the
-# portal gui. Look in the settings.py file for the user and password.
-# n.b. The configure script generates a random password.
-#
-
-import getpass, MySQLdb
-from django.conf import settings
-
-dbname = settings.DATABASES['default']['NAME']
-dbuser = settings.DATABASES['default']['USER']
-dbpass = settings.DATABASES['default']['PASSWORD']
-
-print """WARNING!!!
-WARNING!!!
-WARNING!!!
-
-About to destroy and recreate the database named "%s" and give access
-to the user named "%s".
-""" % (dbname, dbuser)
-
-passwd = getpass.getpass('Please enter your MySQL root password: ')
-
-db = MySQLdb.connect(user='root', passwd=passwd)
-c = db.cursor()
-c.execute('DROP DATABASE IF EXISTS %s' % dbname)
-c.execute('CREATE DATABASE %s CHARACTER SET utf8' % dbname)
-c.execute('GRANT ALL ON %s.* TO %s@localhost identified by %%s' % (dbname, dbuser), (dbpass,))