Azure / Moodle

Tooling and guidance on deploying Scalable Moodle Clusters on Azure.
MIT License
157 stars 166 forks source link

SQL syntax error in install_moodle.sh (moodledbpass) #254

Closed nerudesu closed 3 years ago

nerudesu commented 3 years ago

I've tried to deploy this template with MySQL Version 8.0.

But after the deployment process, I cannot find the config.php file on /moodle/html/moodle

Upon closer inspection, there's a failing on the install_moodle script:

https://github.com/Azure/Moodle/blob/8ac892a959e2e999611b7df8cbac68d7687db790/scripts/install_moodle.sh#L768

From the install.log: + mysql -h mysqlIP -u mysqladminlogin '-pmysqladminpass' -e 'GRANT ALL ON moodledbname.* TO moodledbuser IDENTIFIED BY '\''9#36^xxxxxxxxERCQ'\'';' mysql: [Warning] Using a password on the command line interface can be insecure. ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IDENTIFIED BY '9#36^xxxxxxxxERCQ'' at line 1

Is the SQL syntax error come from passing the moodledbpass with a doubled apostrophe?

Also from the install.log: + export 'moodledbpass=9#36^xxxxxxxxERCQ' + moodledbpass='9#36^xxxxxxxxERCQ'

nerudesu commented 3 years ago

Might just have to update the query: How to grant all privileges to user in MySQL 8.0

nerudesu commented 3 years ago

Solved! As a note, in Azure Database for MySQL service, gateway nodes listen on port 3308 for v5.7 clients and port 3309 for v8.0 clients. Also, here is the reference to related PR #237