From a86c5fbcda6f4efe8b43c786d07066a49aed40fb Mon Sep 17 00:00:00 2001 From: Irtaza Akram Date: Thu, 12 Sep 2024 19:11:25 +0500 Subject: [PATCH] fix: cannot connect --- .github/workflows/ci.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cd6ab872..87cc9916 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,13 +40,17 @@ jobs: sudo apt-get update sudo apt-get install -y mysql-server + # Ensure the MySQL service is started + sudo service mysql start + sudo service mysql status + + # Wait for MySQL service to be fully ready + sleep 10 + # 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 - # 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';"