From 314e6bd254d80aa8058586298200ee96bfdb8feb Mon Sep 17 00:00:00 2001 From: Death-Satan <49744633+Death-Satan@users.noreply.github.com> Date: Wed, 28 Feb 2024 01:08:13 +0800 Subject: [PATCH] Set mysql root password --- .github/workflows/hyperf-test.yml | 1 + .travis/setup.mysql.sh | 2 +- config/autoload/databases.php | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/hyperf-test.yml b/.github/workflows/hyperf-test.yml index 69aab361..0b9efb6e 100644 --- a/.github/workflows/hyperf-test.yml +++ b/.github/workflows/hyperf-test.yml @@ -64,6 +64,7 @@ jobs: collation server: 'utf8_general_ci' # Optional, default value is 'utf8mb4_general_ci'. The '--collation-server' option for mysqld mysql version: '8.0' # Optional, default value is "latest". The version of the MySQL mysql database: 'some_test' # Optional, default value is "test". The specified database which will be create + mysql root password: root - name: Setup PHP uses: shivammathur/setup-php@v2 with: diff --git a/.travis/setup.mysql.sh b/.travis/setup.mysql.sh index 66d7aa12..924cf2e2 100755 --- a/.travis/setup.mysql.sh +++ b/.travis/setup.mysql.sh @@ -4,7 +4,7 @@ CURRENT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) TRAVIS_BUILD_DIR="${TRAVIS_BUILD_DIR:-$(dirname $(dirname $CURRENT_DIR))}" echo -e "Create MySQL database..." -mysql -h 127.0.0.1 -u root -e "CREATE DATABASE IF NOT EXISTS mineadmin charset=utf8mb4 collate=utf8mb4_unicode_ci;" +mysql -h 127.0.0.1 -u root -proot -e "CREATE DATABASE IF NOT EXISTS mineadmin charset=utf8mb4 collate=utf8mb4_unicode_ci;" echo -e "Done\n" diff --git a/config/autoload/databases.php b/config/autoload/databases.php index ca640ea8..ac75a461 100644 --- a/config/autoload/databases.php +++ b/config/autoload/databases.php @@ -21,7 +21,7 @@ 'database' => env('DB_DATABASE', 'hyperf'), 'port' => env('DB_PORT', 3306), 'username' => env('DB_USERNAME', 'root'), - 'password' => env('DB_PASSWORD'), + 'password' => env('DB_PASSWORD','root'), 'charset' => env('DB_CHARSET', 'utf8mb4'), 'collation' => env('DB_COLLATION', 'utf8mb4_unicode_ci'), 'prefix' => env('DB_PREFIX', ''),