diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0588d99f..cd6ab872 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,10 +39,18 @@ jobs: sudo dpkg -i mysql-apt-config_0.8.32-1_all.deb sudo apt-get update sudo apt-get install -y mysql-server + + # Set root password and allow password-based root access + sudo mysql -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root_password';" + sudo mysql -e "FLUSH PRIVILEGES;" + + # Start MySQL service sudo service mysql start - sudo mysql -e 'CREATE DATABASE edx_notes_api;' - sudo mysql -e "CREATE USER 'notes001'@'localhost' IDENTIFIED BY 'secret';" - sudo mysql -e "GRANT ALL PRIVILEGES ON edx_notes_api.* TO 'notes001'@'localhost';" + + # Create database and user + mysql -u root -proot_password -e 'CREATE DATABASE edx_notes_api;' + mysql -u root -proot_password -e "CREATE USER 'notes001'@'localhost' IDENTIFIED BY 'secret';" + mysql -u root -proot_password -e "GRANT ALL PRIVILEGES ON edx_notes_api.* TO 'notes001'@'localhost';" - name: Install Elasticsearch run: |