mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-07 05:45:59 +01:00
bug fix: host selection in remote host;
This commit is contained in:
@@ -82,6 +82,9 @@ class mysqlUtilities:
|
|||||||
|
|
||||||
mysqlUtilities.LOCALHOST = ipAddressLocal
|
mysqlUtilities.LOCALHOST = ipAddressLocal
|
||||||
|
|
||||||
|
if os.path.exists(ProcessUtilities.debugPath):
|
||||||
|
logging.CyberCPLogFileWriter.writeToFile('Local IP for MySQL: %s' % (mysqlUtilities.LOCALHOST))
|
||||||
|
|
||||||
conn = mysql.connect(host=mysqlhost ,user=mysqluser, passwd=mysqlpassword, port=int(mysqlport), cursorclass=cursors.SSCursor)
|
conn = mysql.connect(host=mysqlhost ,user=mysqluser, passwd=mysqlpassword, port=int(mysqlport), cursorclass=cursors.SSCursor)
|
||||||
cursor = conn.cursor()
|
cursor = conn.cursor()
|
||||||
|
|
||||||
@@ -109,18 +112,15 @@ class mysqlUtilities:
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def createDatabase(dbname,dbuser,dbpassword, dbcreate = 1, host = None):
|
def createDatabase(dbname,dbuser,dbpassword, dbcreate = 1, host = None):
|
||||||
try:
|
try:
|
||||||
|
|
||||||
if dbcreate:
|
|
||||||
HostToUse = mysqlUtilities.LOCALHOST
|
|
||||||
else:
|
|
||||||
HostToUse = host
|
|
||||||
|
|
||||||
connection, cursor = mysqlUtilities.setupConnection()
|
connection, cursor = mysqlUtilities.setupConnection()
|
||||||
|
|
||||||
if connection == 0:
|
if connection == 0:
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
if dbcreate == 1:
|
||||||
|
HostToUse = mysqlUtilities.LOCALHOST
|
||||||
|
else:
|
||||||
|
HostToUse = host
|
||||||
## Create db
|
## Create db
|
||||||
|
|
||||||
if dbcreate:
|
if dbcreate:
|
||||||
|
|||||||
Reference in New Issue
Block a user