This document compares query builders and Eloquent ORM in Laravel for database operations.
Query builders allow building queries with PHP methods chained together and protect against SQL injections. They require understanding SQL and can result in unintended database actions if relations are not correctly understood.
Eloquent ORM maps models to database tables, treating records as objects. It allows defining relations and working with databases and records intuitively. While it hides SQL, for beginners it reduces time learning SQL and risk of security issues, making it recommended for initial learning over query builders.
OVN (Open Virtual Network) を用いる事により、OVS (Open vSwitch)が動作する複数のサーバー(Hypervisor/Chassis)を横断する仮想ネットワークを構築する事ができます。
本スライドはOVNを用いた論理ネットワークの構成と設定サンプルのメモとなります。
Using OVN, you can build logical network among multiple servers (Hypervisor/Chassis) running OVS (Open vSwitch).
This slide is describes HOW TO example of OVN configuration to create 2 logical switch connecting 4 VMs running on 2 chassis.
This document compares query builders and Eloquent ORM in Laravel for database operations.
Query builders allow building queries with PHP methods chained together and protect against SQL injections. They require understanding SQL and can result in unintended database actions if relations are not correctly understood.
Eloquent ORM maps models to database tables, treating records as objects. It allows defining relations and working with databases and records intuitively. While it hides SQL, for beginners it reduces time learning SQL and risk of security issues, making it recommended for initial learning over query builders.
OVN (Open Virtual Network) を用いる事により、OVS (Open vSwitch)が動作する複数のサーバー(Hypervisor/Chassis)を横断する仮想ネットワークを構築する事ができます。
本スライドはOVNを用いた論理ネットワークの構成と設定サンプルのメモとなります。
Using OVN, you can build logical network among multiple servers (Hypervisor/Chassis) running OVS (Open vSwitch).
This slide is describes HOW TO example of OVN configuration to create 2 logical switch connecting 4 VMs running on 2 chassis.
21. MySQL 5.6 で利用可能な
認証プラグイン
プラグイン名
説明
商用
Native
デフォルトの認証方式
Old Native
バージョン 4.1 以前の認証方式
SHA-256
SHA-256 をパスワードのハッシュに利用する方式
Clear Text
平文を用いた認証方式。外部認証を行う場合に必
要
PAM
PAM を用いた認証方式。 MySQL サーバーにはパ Y
スワードを平文で送る必要がある
Windows Native
Windows 認証を用いて接続する
Socket PeerCredential
UNIX ドメインソケットで接続するときに利用可能な
特殊なプラグイン。
Y
22. ユーザーの作成例
SHA-256 プラグインの場合
●
ユーザーの作成
–
●
CREATE USER 'sha256user'@'localhost'
IDENTIFIED WITH sha256_password;
パスワードの設定
–
–
SET old_passwords = 2;
SET PASSWORD FOR 'sha256user'@'localhost' =
PASSWORD('sha256P@ss');
28. MySQL で利用可能な文字コード
文字コード名
対応文字
ストレージサイズ
sjis
JIS X 0208:1997
1 〜 2 バイト
cp932
JIS X 0208:1997 + NEC 特殊文字・ IBM
拡張文字
1 〜 2 バイト
ujis
JIS X 0208:1997
1 〜 3 バイト
eucjpms
JIS X 0208:1997 + NEC 特殊文字・ IBM
拡張文字
1 〜 3 バイト
utf8
JIS X 0208:1997 + NEC 特殊文字・ IBM
拡張文字
1 〜 3 バイト
utf8mb4
JIS X 0213:2004
1 〜 4 バイト
31. 文字コードの指定はカラム単位
CREATE TABLE t (
a VARCHAR(100) CHARACTER SET cp932,
b VARCHAR(100) CHARACTER SET eucjpms,
c VARCHAR(100) CHARACTER SET utf8,
:
);
必要に応じて
自動変換
32. MySQL サーバーにおける
文字コード自動変換
④ データを
蓄える際の
文字コード
② クエリの実行
に利用する
文字コード
⑤ テーブル名や
カラム名に対する
文字コード
テーブル
① 送信する
SQL 文に対する
文字コード
クライアント
セッション
MySQL サーバー
⑥ ファイル名を
解決する際の
文字コード
③ クエリの
実行結果に対する
文字コード
ファイルシステム
出展:エキスパートのための MySQL
[運用+管理]トラブルシューティングガイド
33. カラムの文字コードのデフォルト値
CREATE TABLE t (
a VARCHAR(100) CHARACTER SET cp932,
b VARCHAR(100) CHARACTER SET eucjpms,
c VARCHAR(100),
:
指定がない
) CHARACTER SET utf8;
デフォルト値として
テーブルの文字コードが
カラムに適用される
34. テーブルの文字コードのデフォルト値
CREATE TABLE t (
a VARCHAR(100),
b VARCHAR(100),
c VARCHAR(100),
:
);
カラム、テーブル双方に
文字コードの指定がない
CREATE DATABASE db CHARACTER SET utf8;
データベースの文字コードが適用される
49. Explain
mysql> EXPLAIN SELECT 'cond1' AS LABEL, COUNT(1) AS COUNT FROM Country WHERE Code LIKE 'J%' UNION SELECT 'cond2', COUNT(1)
FROM Country WHERE IndepYear > 1900 UNION SELECT 'cond3', COUNT(1) FROM Country WHERE Continent = 'Africa' UNION SELECT
'cond4', count(1) FROM Country WHERE Name = LocalName;
+----+--------------+----------------+-------+---------------+---------+---------+------+------+--------------------------+
| id | select_type | table
| type | possible_keys | key
| key_len | ref | rows | Extra
|
+----+--------------+----------------+-------+---------------+---------+---------+------+------+--------------------------+
| 1 | PRIMARY
| Country
| range | PRIMARY
| PRIMARY | 3
| NULL |
3 | Using where; Using index |
| 2 | UNION
| Country
| ALL
| NULL
| NULL
| NULL
| NULL | 239 | Using where
|
| 3 | UNION
| Country
| ALL
| NULL
| NULL
| NULL
| NULL | 239 | Using where
|
| 4 | UNION
| Country
| ALL
| NULL
| NULL
| NULL
| NULL | 239 | Using where
|
| NULL | UNION RESULT | <union1,2,3,4> | ALL
| NULL
| NULL
| NULL
| NULL | NULL | Using temporary
|
+----+--------------+----------------+-------+---------------+---------+---------+------+------+--------------------------+
5 rows in set (0.00 sec)