Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/solareenlo/mysql-nextjs-test
https://github.com/solareenlo/mysql-nextjs-test
Last synced: 4 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/solareenlo/mysql-nextjs-test
- Owner: solareenlo
- Created: 2021-03-03T19:15:37.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-03-03T19:37:53.000Z (almost 4 years ago)
- Last Synced: 2024-11-08T02:46:15.520Z (about 2 months ago)
- Language: Python
- Size: 2.93 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# mysql-nextjs-test
- https://github.com/solareenlo/nextjs-mysql-test の DB.
- nextjs-mysql-test 用の mysql を docker-compose で動かす.## Prerequisites
- Ubuntu 20.04
- ufw
- [Install Docker Engine on Ubuntu](https://docs.docker.com/engine/install/ubuntu/)
- [Install Docker Compose](https://docs.docker.com/compose/install/)## Usage
```sh
git clone [email protected]:solareenlo/mysql-nextjs-test.git
cd mysql-nextjs-test
cp .env.example .env
vim .env
# 以下の4つを .env 内に設定する.
# MYSQL_ROOT_PASSWORD=xxxxxx
# MYSQL_DATABASE=xxxxx
# MYSQL_USER=xxx
# MYSQL_PASSWORD=xxxxsudo docker-compose up -d
bash init-mysql.sh
sudo docker-compose exec db bash
mysql -u root -p
show databases;
use sample;
show tables;
select * from xxx;
exit
exti
sudo docker-compose down
```## References
- [Ubuntu 20.04でDocker Composeを使用してLaravelをインストールおよびセットアップする方法](https://www.digitalocean.com/community/tutorials/how-to-install-and-set-up-laravel-with-docker-compose-on-ubuntu-20-04-ja)
- [docker-compose でMySQL環境簡単構築](https://qiita.com/A-Kira/items/f401aea261693c395966)
- [DockerでMySQL8.0を使う方法](https://www.trifields.jp/how-to-use-mysql-8-0-on-docker-4514)