mirror of
https://github.com/OpenFusionProject/scripts.git
synced 2024-11-26 07:10:06 +00:00
Compare commits
2 Commits
5bf1ce01e3
...
4196766a2b
Author | SHA1 | Date | |
---|---|---|---|
4196766a2b | |||
7922fc060a |
@ -4,6 +4,7 @@ version: '3.1'
|
|||||||
services:
|
services:
|
||||||
db:
|
db:
|
||||||
image: mysql:5.5.42
|
image: mysql:5.5.42
|
||||||
|
command: --character-set-server utf8
|
||||||
restart: always
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
- 3306:3306
|
- 3306:3306
|
||||||
|
@ -179,6 +179,7 @@ def main(conn, xdt_path):
|
|||||||
for table_name in root:
|
for table_name in root:
|
||||||
if "Table" in table_name:
|
if "Table" in table_name:
|
||||||
process_xdt_table(cursor, root, table_name, mappings)
|
process_xdt_table(cursor, root, table_name, mappings)
|
||||||
|
finalize(cursor)
|
||||||
conn.commit()
|
conn.commit()
|
||||||
|
|
||||||
def connect_to_db():
|
def connect_to_db():
|
||||||
@ -192,10 +193,18 @@ def connect_to_db():
|
|||||||
def prep_db():
|
def prep_db():
|
||||||
conn = connect_to_db()
|
conn = connect_to_db()
|
||||||
cursor = conn.cursor()
|
cursor = conn.cursor()
|
||||||
|
# we have to upload a lot of data, so we need to raise the limit
|
||||||
cursor.execute("SET GLOBAL max_allowed_packet=1073741824")
|
cursor.execute("SET GLOBAL max_allowed_packet=1073741824")
|
||||||
conn.commit()
|
conn.commit()
|
||||||
conn.close()
|
conn.close()
|
||||||
|
|
||||||
|
def finalize(cursor):
|
||||||
|
# credentials used by the game
|
||||||
|
cursor.execute("GRANT SELECT ON XDB.* TO 'cmog' IDENTIFIED BY 'scooby'")
|
||||||
|
# change the root password to something more secure
|
||||||
|
new_root_pw = input("Enter new root password: ")
|
||||||
|
cursor.execute(f"SET PASSWORD = PASSWORD('{new_root_pw}')")
|
||||||
|
|
||||||
# %%
|
# %%
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
if len(sys.argv) != 2:
|
if len(sys.argv) != 2:
|
||||||
|
Loading…
Reference in New Issue
Block a user