Skip to content

Commit

Permalink
try to fix mysql-lib missing error on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Anyu AY5 Wang authored and Anyu AY5 Wang committed Mar 12, 2024
1 parent 70c6bc0 commit 0fa06ba
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 13 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@ jobs:
port=3306
- name: Set MySQLCLIENT_LIB_DIR
run: echo "MYSQLCLIENT_LIB_DIR=C:\hostedtoolcache\windows\mysql\5.7.44\x64\lib\mysqlclient.lib" | Out-File -FilePath $env:GITHUB_ENV -Append
# - run: echo "$env:MYSQLCLIENT_LIB_DIR"
# - run: setx MYSQLCLIENT_LIB_DIR C:\hostedtoolcache\windows\mysql\5.7.44\x64\lib\
# - run: dir $env:MYSQLCLIENT_LIB_DIR
- run: setx MYSQLCLIENT_LIB_DIR C:\hostedtoolcache\windows\mysql\5.7.44\x64\lib\mysqlclient.lib
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
Expand Down
6 changes: 4 additions & 2 deletions doc/backend/database/mysql/mysql.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@ Firstly, define the `MYSQLCLIENT_LIB_DIR` environment variable. The process vari
setx MYSQLCLIENT_LIB_DIR "your path to mysqlclient.lib"
```

- **GitHub Actions**:
- **GitHub Actions on Windows**:
```shell
- run: echo "MYSQLCLIENT_LIB_DIR=C:\hostedtoolcache\windows\mysql\5.7.44\x64\lib\" | Out-File -FilePath $env:GITHUB_ENV -Append
- run: echo "MYSQLCLIENT_LIB_DIR=C:\hostedtoolcache\windows\mysql\5.7.44\x64\lib\mysqlclient.lib" | Out-File -FilePath $env:GITHUB_ENV -Append
```

> Note: If you do not only set the `mysqlclient.lib` file, it may result in duplicate library errors during compilation.

### Step 2: Install Diesel CLI
Install `diesel_cli` using the `cargo` command:

Expand Down
8 changes: 0 additions & 8 deletions tests/mysql_ini/my.cnf

This file was deleted.

Binary file removed tests/mysql_ini/mysqlclient.lib
Binary file not shown.

0 comments on commit 0fa06ba

Please sign in to comment.