1
0

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.

Ubuntu Server 20.04.3 LTS 構築#21 Docker構築(MYSQLのコンテナ作成~データベース作成)

Last updated at Posted at 2022-03-12

実施日:2022/03/06~

【今回の内容】
MySQLのコンテナ作成

MySQLのコンテナ作成

1.MySQLコンテナ作成

docker run --name mysql-numbers -e MYSQL_ROOT_PASSWORD=rootのPW -e MYSQL_DATABASE=データべーし領域名 -e MYSQL_USER=ユーザー名 -e MYSQL_PASSWORD=ユーザーのPW mysql  --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --default-authentication-plugin=mysql_native_password

2.コンテナの動作確認

docker ps -a

MYSQL操作

1.Dockerログイン

docker exec -it コンテナ名 bash

2.MYSQLへログイン

mysql -u root -p
Enter password: 

3.データベースの作成

CREATE DATABASES データベース名;

4.データベースの一覧確認

SHOW DATABASES;

関連項目

インストール~基本操作迄

参考サイト様

・@pugiemonn様

1
0
2

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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?