0
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 3 years have passed since last update.

MySQLをstristモードへ設定する方法(ファイルの書き換え)

Posted at

前提

OSはWindows
サーバーはxampp
DBはMySQL

結論

xampp -> mysql -> bin フォルダ内にある
「my.ini」ファイルを書き換えれば設定を変更することができる。

strictモードとは

文字数がオーバーしていたり、カラム指定外のデータ型など、予期せぬデータが挿入されたときにエラーとして扱ってくれるもの。
詳しくはこちらを参照してください。他の設定の内容についても解説してあります。
https://www.wakuwakubank.com/posts/414-mysql-sqlmode/

方法

こちらのテキストファイルを開く
image.png

その中の「mysql=MODE」の項目を編集する。
STRICT_TRANS_TABLESを追加。
image.png

MySQLを一旦stopして再起動させる。
すると設定が変更されている。

0
0
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
0
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?