1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

GitHub CodespacesにMySQLをインストール

Last updated at Posted at 2023-01-30
sudo apt update \
  && sudo apt install -y mysql-server \
  && sudo service mysql start \
  && echo "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY ''" | sudo mysql \
  && sudo service --status-all \
  && mysql -h127.0.0.1 -uroot

PHPから触るには?

sudo apt install -y php-mysql

もしくは

Laravelの場合

sudo apt update
sudo apt install software-properties-common ca-certificates lsb-release apt-transport-https
LC_ALL=C.UTF-8 sudo add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt install -y php8.2 php8.2-mysql php8.2-mbstring php8.2-xml php8.2-curl
echo APP_URL=https://$CODESPACE_NAME-8000.app.github.dev >> .env
php8.2 artisan serve
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?