Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
Help us understand the problem. What is going on with this article?

EC2でのMySQL 各エラー対応

◯[Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).

my.cnf
[mysqld]
explicit_defaults_for_timestamp = 1

参考サイト:https://qiita.com/nnmr/items/79400922df5810756bce

◯mysqld --initialize(MySQLの初期化エラー)

sudo mysqld --initialize --user=mysql
[ERROR] --initialize specified but the data directory has files in it. Aborting.
[ERROR] Aborting

- 解決策

my.cnf
datadir  = /data/mysql
tmpdir   = /data/mysql/tmp
innodb_data_home_dir            = ibdata
innodb_log_group_home_dir       = iblog
rm -fr /data/mysql/*
install -d -o mysql -g mysql -m 750 /data/mysql/{tmp,ibdata,iblog}
mysqld --initialize  --user=mysql --ignore-db-dir=tmp --ignore-db-dir=ibdata --ignore-db-dir=iblog
echo $?
0

参考サイト
https://hirose31.hatenablog.jp/entry/20161004/1475582156

エラー対応後、追記していく。

akk_ayy
4/6〜プログラミング学習中。テックキャンプ75期生。プログラミングの学習についてや学んだことをまとめます。HTML/CSS,Ruby,rails,JS,Java
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away