gpt4 book ai didi

ubuntu - 在 GitHub 操作 Ubuntu 20.04 上安装 mysql-client

转载 作者:行者123 更新时间:2023-12-04 18:37:09 24 4
gpt4 key购买 nike

我正在尝试使用在 GitHub 操作 ubuntu 20.04 上安装 mysql 客户端sudo apt-get -f install mysql-client .它失败了:

mysql-client : Depends: mysql-client-8.0 but it is not going to beinstalled E: Unable to correct problems, you have held brokenpackages.


这是包含 mysql-client 安装的作业:
 test:
name: Unit and Integration Tests
runs-on: ubuntu-20.04
needs:
- pre-ci
steps:
- name: Checkout the code
uses: actions/checkout@v2
- name: Setup python
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Install python dev dependencies
run: |
python3 -m pip install --upgrade pip
pip3 install -r requirements-dev.txt
- name: Setup Chrome webdriver
uses: nanasess/setup-chromedriver@master
- name: Setup Chrome Display
run: |
sudo Xvfb -ac :99 -screen 0 1280x1024x24 > /dev/null 2>&1 & # optional, disables headless mode
- name: Install the MySQL client
run: sudo apt-get update & sudo apt-get upgrade & sudo apt-get -f install mysql-client
- name: Create a .env file
run: |
cat << EOF > .env
MYSQL_HOST=localhost
MYSQL_USER=asset-app
MYSQL_PASSWORD=password
MYSQL_DATABASE=asset_db
MYSQL_PORT=3306
REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_DB=0
SECRET_KEY=bff4eb94deb028b293786461
EOF
- name: Docker compose up
run: docker-compose up -d
- name: Wait for 15 seconds for the setup to start
run: sleep 15
- name: Add mysql tables and data
run: |
mysql -h localhost -P 3306 --protocol=tcp -u root --password=password < scripts/table.sql
- name: Test with pytest
run: |
pytest tests --verbose --failed-first
ls -la
env:
DISPLAY: :99
- name: Kill the docker compose
run: docker-compose kill
- name: cancel workflow
if: failure()
uses: andymckay/cancel-action@0.2
我用 sudo apt-get update & sudo apt-get upgrade 尝试了命令.但没有运气。如何安装 mysql 客户端?

最佳答案

GitHub Actions 现在默认安装 mysql-client 和一些 mysql 包。因此无需安装 mysql-client,如果尝试安装会失败。所以我通过删除 mysql-client 安装步骤解决了这个问题

关于ubuntu - 在 GitHub 操作 Ubuntu 20.04 上安装 mysql-client,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70465073/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com