mysql

mysql 接続数の確認

最大接続数設定

mysql> show global variables like 'max_connections';
+-----------------+-------+
| Variable_name | Value |
+-----------------+-------+
| max_connections | 151 |
+-----------------+-------+
1 row in set (0.00 sec)

起動してからの累積接続数

mysql> show global status like 'Connections';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| Connections | 206 |
+---------------+-------+
1 row in set (0.00 sec)

起動してからこれまでの最大同時接続数

mysql> show global status like 'Max_used_connections';
+----------------------+-------+
| Variable_name | Value |
+----------------------+-------+
| Max_used_connections | 4 |
+----------------------+-------+
1 row in set (0.00 sec)

mysql CSVでデータの吐き出し

mysql CSVでデータの吐き出し

SELECT
*
FROM
users
ORDER BY id
INTO OUTFILE
“/tmp/users.csv”
FIELDS
TERMINATED BY ‘,’
ENCLOSED BY ‘”‘
ESCAPED BY ‘\\’
LINES
TERMINATED BY ‘\r\n’
;

メモに