Commit 5f832754703f3847541f3b0e313ba1cee9418fa9
1 parent
a1dbc688
Exists in
dev
fixing req_centos
Showing
1 changed file
with
3 additions
and
2 deletions
Show diff stats
install/install.py
... | ... | @@ -162,6 +162,8 @@ def install_python_modules(venv): |
162 | 162 | sql_pswd = "DjangoPyros" |
163 | 163 | req = "CREATE DATABASE IF NOT EXISTS pyros; CREATE USER IF NOT EXISTS pyros; GRANT USAGE ON *.* TO 'pyros'; DROP USER 'pyros'; GRANT ALL ON pyros.* TO 'pyros'@'localhost' IDENTIFIED BY 'DjangoPyros'; GRANT ALL ON test_pyros.* TO 'pyros'@'localhost'; GRANT ALL PRIVILEGES ON test_pyros_test.* TO 'pyros'@'localhost';" |
164 | 164 | req_centos = "CREATE DATABASE IF NOT EXISTS pyros; CREATE DATABASE IF NOT EXISTS pyros_test; GRANT USAGE ON *.* TO 'pyros@localhost' IDENTIFIED BY 'DjangoPyros' WITH GRANT OPTION; DROP USER pyros; CREATE USER 'pyros' IDENTIFIED BY 'DjangoPyros'; GRANT ALL PRIVILEGES ON pyros.* TO 'pyros'@'localhost' IDENTIFIED BY 'DjangoPyros' WITH GRANT OPTION; GRANT ALL PRIVILEGES ON test_pyros.* TO pyros@localhost IDENTIFIED BY 'DjangoPyros' WITH GRANT OPTION;" |
165 | + if platform.dist()[0] == "centos": | |
166 | + req = req_centos | |
165 | 167 | sql_request="\"" + req + "\"" + " | mysql -u root -p" |
166 | 168 | if (platform.system() == "Windows"): |
167 | 169 | end_of_line = "\r\n\r\n" |
... | ... | @@ -216,8 +218,7 @@ def install_python_modules(venv): |
216 | 218 | sql_pswd = "DjangoPyros" |
217 | 219 | ''' |
218 | 220 | |
219 | - if platform.dist()[0] == "centos": | |
220 | - req = req_centos | |
221 | + | |
221 | 222 | print(Colors.LOG_BLUE + end_of_line+"-----------------------------Launching mysql to create database and create and grant user pyros-----------------------------" + Colors.END) |
222 | 223 | print(Colors.LOG_BLUE +"-----------------------------Please enter your MYSQL root password-----------------------------" + Colors.END) |
223 | 224 | process = subprocess.Popen("echo " + sql_request, shell=True) | ... | ... |