izumin5210-sandbox / isucon7-q-20180430

0 stars 0 forks source link

MySQL 操作ログ #11

Open izumin5210 opened 6 years ago

izumin5210 commented 6 years ago

WHY

MySQL の conf を symlink にしたらぶっ壊れたので管理しないことにした なにやったか覚えとくためにここに残す

izumin5210 commented 6 years ago

isu1 -> isu3 に DB つなぐ

isucon@ip-10-0-0-113:~/webapp$ cat /etc/mysql/mysql.conf.d/mysqld.cnf | grep bind
bind-address            = 0.0.0.0
isucon@ip-10-0-0-113:~/webapp$ sudo mysql -u root
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 13
Server version: 5.7.22-0ubuntu0.16.04.1-log (Ubuntu)

Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> GRANT ALL PRIVILEGES ON *.* TO isucon@'10.0.0.%' IDENTIFIED BY 'isucon' WITH GRANT OPTION;
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> exit
Bye
izumin5210 commented 6 years ago

パラメタいじった

/etc/mysql/my.cnf

[mysqld]
innodb_buffer_pool_size = 1G
innodb_flush_log_at_trx_commit = 0
innodb_flush_method=O_DIRECT

slow_query_log                = 1
slow_query_log_file           = /var/lib/mysql/mysqld-slow.log
long_query_time               = 0
log-queries-not-using-indexes = 1