ããã¯ããªã«ãããããŠæžãããã®ïŒ
MySQL 9.7ããªãªãŒã¹ãããŠããå幎è¿ãçµã£ãã®ã§ããããã1床ã€ã³ã¹ããŒã«ããèŠãŠãããããªãšããããšã§ã
ãªãªãŒã¹äºæ
ã®ãã£ããã¢ãããããŠãããŸãã
MySQL 9.7
MySQL 9.7ã¯ã2026幎4æã«ãªãªãŒã¹ããã2çªç®ã®LTSã§ãã
MySQL :: MySQL 9.7 Reference Manual :: 1.3 MySQL Releases: Innovation and LTS
LTSãšããã²ãšã€ã®äœç³»ã§ããInnovationã«ã€ããŠã¯ãMySQL 8.4ã®ã€ã³ã¹ããŒã«ã«ã€ããŠæžããæã«ãŸãšããŠãããŸããã
Ubuntu Linux 22.04 LTSにMySQL 8.4をインストールする(設定へのドキュメントまとめ付き) - CLOVER🍀
ãªãªãŒã¹ã«é¢ããããã°ã¯ãã¡ãã
MySQL 9.7.0 LTS リリース: Community Editionの機能拡張とEnterprise Editionでのダイナミック・データマスキングのサポート | mysql-jp
9.7.0ã®ãªãªãŒã¹ããŒãã¯ãã¡ãã
MySQL :: MySQL 9.7 Release Notes :: Changes in MySQL 9.7.0 (2026-04-21)
MySQL 9.7ã®æ°æ©èœãéæšå¥šã»åé€ãããæ©èœã¯ãã¡ãã
MySQL :: MySQL 9.7 Reference Manual :: 1.4 What Is New in MySQL 9.7
ãªã®ã§ããããã®ããŒãžã¯MySQL 9.6ããã®å€æŽå
容ã«ãªã£ãŠããŸãã
ã²ãšã€åã®LTSã§ããMySQL 8.4ããã©ã®ãããªå€æŽããã£ãã®ããŸãšããŠèŠãããšããã§ãããããããããã¥ã¡ã³ãã¯
ãªãããã§ãããã¡ãã§ãªã¯ãšã¹ããæãã£ãŠããŸãããã©ãã§ããããâŠã
MySQL Bugs: #120348: Doc Request: What Is New in MySQL 9.7 between MySQL 8.4 LTS and MySQL 9.7 LTS
ãšããããã§ãMySQL 8.4ããã®å€æŽå
容ããŸãšããŠç¥ããã人ã¯ãä»ã¯ãã®ããããèŠãã®ããããšæããŸãã
MySQL 9.7.0 LTS リリース: Community Editionの機能拡張とEnterprise Editionでのダイナミック・データマスキングのサポート | mysql-jp
MySQL 8.4 LTS to MySQL 9.7 LTS - Speaker Deck
第129回 MySQL 9.7.0 LTSリリース、PostgreSQLエンタープライズ・コンソーシアム成果報告会がまもなく | gihyo.jp
倧ããªå€æŽå
容ã¯ãã®ãããã§ããããã
- ã¬ããªã±ãŒã·ã§ã³
- InnoDB Clusterã®ãããŒå¶åŸ¡ã¢ãã¿ãªã³ã°
- ãã«ãã¹ã¬ããã»ã¢ãã©ã€ã€ãŒã®æ¡åŒµçµ±èš
- ããŒãã®èªååé€ãèªå埩æ§
- ææ°ã®ãã©ã€ããªãŒéžåº
- ãã¬ã¡ããªãŒã»Observability
- OpenTelemetryãµããŒã
- ã¯ãšãªãŒã®æé©åã»ããã©ãŒãã³ã¹
- Hypergraph Optimizer
- PGOïŒãããã¡ã€ã«ã¬ã€ãæé©åïŒ
- ã¢ããªã±ãŒã·ã§ã³éçº
- JSON Duality View
- VECTORåã®è¿œå
ãã£ãããšã¯ãã¡ãã®ããã°ãšã³ããªãŒãèªãã®ãããã§ãããã
MySQL 9.7.0 LTS リリース: Community Editionの機能拡張とEnterprise Editionでのダイナミック・データマスキングのサポート | mysql-jp
ã§ã¯ãMySQL 9.7ãaptãªããžããªãŒããã€ã³ã¹ããŒã«ããŠã¿ãŸãã
MySQL :: Download MySQL APT Repository
MySQL :: MySQL 9.7 Reference Manual :: 2.5.2 Installing MySQL on Linux Using the MySQL APT Repository
ç°å¢
ä»åã®ç°å¢ã¯ãã¡ãã
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 26.04.1 LTS
Release: 26.04
Codename: resolute
$ uname -srvmo
Linux 7.0.0-42-generic
MySQL 9.7ãaptãªããžããªãŒããã€ã³ã¹ããŒã«ãã
ããã§ã¯ãMySQL 9.7ããã¡ãã®æé ã«æ²¿ã£ãŠã€ã³ã¹ããŒã«ããŸãã
MySQL :: MySQL 9.7 Reference Manual :: 2.5.2 Installing MySQL on Linux Using the MySQL APT Repository
ãªããžããªãŒã®debãã¡ã€ã«ãããŠã³ããŒãã
$ curl -LO https://dev.mysql.com/get/mysql-apt-config_0.8.40-1_all.deb
ã€ã³ã¹ããŒã«ã
$ sudo dpkg -i mysql-apt-config_0.8.40-1_all.deb
ããã©ã«ãã§ã¯MySQL 8.4ãã€ã³ã¹ããŒã«ãããããã§ãã

mysql-9.7-ltsãéžæããŸãã

ãã®ç¶æ
ã§ãOKããéžæããŸãã

ãªããžããªãŒã®æ
å ±ãæŽæ°ã
$ sudo apt update
MySQLãµãŒããŒãã€ã³ã¹ããŒã«ã
$ sudo apt install mysql-server
åæã«MySQLã¯ã©ã€ã¢ã³ããã€ã³ã¹ããŒã«ãããŸãã
Installing:
mysql-server
Installing dependencies:
libcgi-fast-perl libencode-locale-perl libfcgi0t64 libhtml-tagset-perl libhttp-message-perl libmecab2 libtimedate-perl mysql-client-core
libcgi-pm-perl libfcgi-bin libgoogle-perftools4t64 libhtml-template-perl libio-html-perl libprotobuf-lite32t64 liburi-perl mysql-common
libclone-perl libfcgi-perl libhtml-parser-perl libhttp-date-perl liblwp-mediatypes-perl libtcmalloc-minimal4t64 mysql-client mysql-server-core
ææ¡ããã±ãŒãž:
libdata-dump-perl libipc-sharedcache-perl libio-compress-brotli-perl libbusiness-isbn-perl libmime-base32-perl libregexp-ipv6-perl libwww-perl
æšå¥šããã±ãŒãž:
mecab-ipadic-utf
ããã¥ã¡ã³ãã§ã¯rootãŠãŒã¶ãŒã®ãã¹ã¯ãŒãã®èšå®ãæ±ãããããšããããšã ã£ãã®ã§ãããèãããŸããã§ãããâŠã
ã€ã³ã¹ããŒã«ãå®äºããæç¹ã§ãMySQLãµãŒããŒã¯èµ·åããŠããŸããèªåèµ·åãæå¹ã§ãã
$ sudo systemctl status mysql
â mysql.service - MySQL Community Server
Loaded: loaded (/usr/lib/systemd/system/mysql.service; enabled; preset: enabled)
Active: active (running) since Sat 2026-10-31 19:26:02 JST; 1min 39s ago
Invocation: e699753bef8a49dab3436acbe1eac9b6
Process: 2262 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
Main PID: 2272 (mysqld)
Status: "Server is operational"
Tasks: 34 (limit: 8173)
Memory: 479M (peak: 479.2M)
CPU: 1.545s
CGroup: /system.slice/mysql.service
ââ2272 /usr/sbin/mysqld
10æ 31 19:26:01 server systemd[1]: Starting mysql.service - MySQL Community Server...
10æ 31 19:26:02 server systemd[1]: Started mysql.service - MySQL Community Server.
MySQLã¯ã©ã€ã¢ã³ãã®ããŒãžã§ã³ã
$ mysql --version
mysql Ver 8.4.11-0ubuntu0.26.04.1 for Linux on x86_64 ((Ubuntu))
8.4ã§ããâŠã
ããã§ãã¡ãã®ããŒãžãèŠããšãåæã®ãã¹ã¯ãŒããããããªãå Žåã¯error.logãèŠãããšãšæžããŠãããŸããã
If you do not know the initial random password, look in the server error log.
MySQL :: MySQL 9.7 Reference Manual :: 2.9.4 Securing the Initial MySQL Account
èŠãŠã¿ãŸãããã
$ sudo cat /var/log/mysql/error.log
2026-10-31T10:25:52.378743Z 0 [System] [MY-015017] [Server] MySQL Server Initialization - start.
2026-10-31T10:25:52.379892Z 0 [System] [MY-013169] [Server] /usr/sbin/mysqld (mysqld 8.4.11-0ubuntu0.26.04.1) initializing of server in progress as process 2150
2026-10-31T10:25:52.393167Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2026-10-31T10:25:52.909413Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2026-10-31T10:25:55.374986Z 6 [Warning] [MY-010453] [Server] root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.
2026-10-31T10:25:57.796266Z 6 [System] [MY-013172] [Server] Received SHUTDOWN from user boot. Shutting down mysqld (Version: 8.4.11-0ubuntu0.26.04.1).
2026-10-31T10:26:01.294009Z 0 [System] [MY-015018] [Server] MySQL Server Initialization - end.
2026-10-31T10:26:01.753475Z 0 [System] [MY-015015] [Server] MySQL Server - start.
2026-10-31T10:26:01.968365Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.4.11-0ubuntu0.26.04.1) starting as process 2272
2026-10-31T10:26:01.985040Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2026-10-31T10:26:02.398015Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2026-10-31T10:26:02.839300Z 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2026-10-31T10:26:02.839342Z 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2026-10-31T10:26:02.870330Z 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '127.0.0.1' port: 33060, socket: /var/run/mysqld/mysqlx.sock
2026-10-31T10:26:02.870360Z 0 [System] [MY-010931] [Server] /usr/sbin/mysqld: ready for connections. Version: '8.4.11-0ubuntu0.26.04.1' socket: '/var/run/mysqld/mysqld.sock' port: 3306 (Ubuntu).
ã©ããã空ã®ãã¹ã¯ãŒããèšå®ãããŠããããã§ãâŠã
2026-10-31T10:25:55.374986Z 6 [Warning] [MY-010453] [Server] root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.
ãã¹ã¯ãŒããèšå®ãããŠããªãå Žåã¯ããã¹ã¯ãŒããªãã§ãã°ã€ã³ããã°ããããã§ãã
If the root account exists but has no password, connect to the server as root using no password, then assign a password.
ãã¡ãã¯å€±æããŸãã
$ mysql -uroot --skip-password
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1698 (28000): Access denied for user 'root'@'localhost'
OSã®ç®¡çè
æš©éã䜿ããšãã°ã€ã³ã§ããŸããã
$ sudo mysql -uroot --skip-password
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 19
Server version: 8.4.11-0ubuntu0.26.04.1 (Ubuntu)
Copyright (c) 2000, 2026, Oracle and/or its affiliates.
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>
ãã¹ã¯ãŒããèšå®ã
mysql> alter user 'root'@'localhost' identified by '[ãã¹ã¯ãŒã]';
Query OK, 0 rows affected (0.01 sec)
ã§ãããæ¥ç¶ã§ããŸããâŠã
$ mysql -uroot -p
Enter password:
ERROR 1698 (28000): Access denied for user 'root'@'localhost'
ã©ãããããšã§ãããïŒãšæã£ãŠãrootãŠãŒã¶ãŒã®æ
å ±ãèŠãŠã¿ãŸãã
$ sudo mysql -uroot --skip-password
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 19
Server version: 8.4.11-0ubuntu0.26.04.1 (Ubuntu)
Copyright (c) 2000, 2026, Oracle and/or its affiliates.
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> use mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> select host, user, plugin from user;
+-----------+------------------+-----------------------+
| host | user | plugin |
+-----------+------------------+-----------------------+
| localhost | debian-sys-maint | auth_socket |
| localhost | mysql.infoschema | caching_sha2_password |
| localhost | mysql.session | caching_sha2_password |
| localhost | mysql.sys | caching_sha2_password |
| localhost | root | auth_socket |
+-----------+------------------+-----------------------+
5 rows in set (0.01 sec)
ã©ããããœã±ãããã©ã°ã€ã³èªèšŒã®ããã§ãã
MySQL :: MySQL 9.7 Reference Manual :: 8.4.1.10 Socket Peer-Credential Pluggable Authentication
ãšããããšã¯âŠ
$ sudo mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 21
Server version: 8.4.11-0ubuntu0.26.04.1 (Ubuntu)
Copyright (c) 2000, 2026, Oracle and/or its affiliates.
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>
ããã§æ¥ç¶ã§ããŸããâŠã
MySQLãµãŒããŒã®ããŒãžã§ã³ãèŠãŠãããŸãããã
mysql> select version();
+
| version() |
+
| 8.4.11-0ubuntu0.26.04.1 |
+
1 row in set (0.00 sec)
äžè¬ãŠãŒã¶ãŒã®äœæãªã©ã¯ä»åã¯ãã¹ããŸãã
MySQLãµãŒããŒã®åæ¢ã
$ sudo systemctl stop mysql
MySQLãµãŒããŒã®èµ·åã
$ sudo systemctl start mysql
MySQL Shellãã€ã³ã¹ããŒã«ãã
MySQLã¯ã©ã€ã¢ã³ããšããŠã¯ãMySQL Shellã䜿ããŸãããã
ããã±ãŒãžã®æ
å ±ã確èªã
$ apt show mysql-shell
Package: mysql-shell
Version: 8.4.8+dfsg-0ubuntu1
Priority: optional
Section: universe/database
Origin: Ubuntu
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 41.0 MB
Depends: libantlr4-runtime4.10 (>= 4.10+dfsg), libc6 (>= 2.38), libcurl4t64 (>= 7.16.2), libgcc-s1 (>= 3.3.1), liblz4-1 (>= 0.0~r127), libprotobuf32t64 (>= 3.21.12), libpython3.14 (>= 3.14.1), libssh-4 (>= 0.9.2), libssl>
Homepage: http://dev.mysql.com/downloads/shell
Download-Size: 10.0 MB
APT-Sources: http://archive.ubuntu.com/ubuntu resolute/universe amd64 Packages
Description: MySQL Shell (part of MySQL Server) 8.4
MySQL query and administration shell client and framework.
ãã¡ãã¯MySQL 8.4ãªã®ã§ããããâŠïŒ
ã©ããããã®ããã§ãâŠïŒ
$ apt list mysql-shell --all-versions
mysql-shell/resolute 8.4.8+dfsg-0ubuntu1 amd64
èŠãŠã¿ããšãMySQL Shellã®9.7ã¯æ¬åœã«ãªãããã§ããã
ã€ã³ã¹ããŒã«ã
$ sudo apt install mysql-shell
ããŒãžã§ã³ã
$ mysqlsh --version
mysqlsh Ver 8.4.8 for Linux on x86_64 - for MySQL 8.4.8 (Source distribution)
rootã§æ¥ç¶ããå Žåã¯ãUNIXãã¡ã€ã³ãœã±ãããæå®ããŸãããã
$ sudo mysqlsh --socket=/var/run/mysqld/mysqld.sock
ãã¹ã¯ãŒãã¯å
¥åããããã®ãŸãŸEnterã§å
¥ããŸãã
Please provide the password for 'root@/var%2Frun%2Fmysqld%2Fmysqld.sock':
Save password for 'root@/var%2Frun%2Fmysqld%2Fmysqld.sock'? [Y]es/[N]o/Ne[v]er (default No): v
MySQL Shell 8.4.8
Copyright (c) 2016, 2026, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates.
Other names may be trademarks of their respective owners.
Type '\help' or '\?' for help; '\quit' to exit.
Creating a session to 'root@/var%2Frun%2Fmysqld%2Fmysqld.sock'
Fetching global names for auto-completion... Press ^C to stop.
Your MySQL connection id is 19
Server version: 8.4.11-0ubuntu0.26.04.1 (Ubuntu)
No default schema selected; type \use <schema> to set one.
MySQL localhost SQL > select version();
+-------------------------+
| version() |
+-------------------------+
| 8.4.11-0ubuntu0.26.04.1 |
+-------------------------+
1 row in set (0.0005 sec)
--no-passwordãæå®ããŠãOKã§ãã
$ sudo mysqlsh --socket=/var/run/mysqld/mysqld.sock --no-password
MySQL Shell 8.4.8
Copyright (c) 2016, 2026, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates.
Other names may be trademarks of their respective owners.
Type '\help' or '\?' for help; '\quit' to exit.
WARNING: Using a password on the command line interface can be insecure.
Creating a session to 'root@/var%2Frun%2Fmysqld%2Fmysqld.sock'
Fetching global names for auto-completion... Press ^C to stop.
Your MySQL connection id is 9
Server version: 8.4.11-0ubuntu0.26.04.1 (Ubuntu)
No default schema selected; type \use <schema> to set one.
MySQL localhost SQL >
èšå®ãã¡ã€ã«ã確èªãã
èšå®ãã¡ã€ã«ã確èªããŠã¿ãŸãããã
$ tree /etc/mysql
/etc/mysql
âââ conf.d
â  âââ mysql.cnf
â  âââ mysqldump.cnf
âââ debian-start
âââ debian.cnf
âââ my.cnf -> /etc/alternatives/my.cnf
âââ my.cnf.fallback
âââ mysql.cnf
âââ mysql.conf.d
âââ mysql.cnf
âââ mysqld.cnf
3 directories, 9 files
MySQL 8.4ã«æ¯ã¹ããšãèŠç¥ãã¬ãã¡ã€ã«ãå¢ããŠããŸãã
debianããšããèŠç¥ãã¬ãã¡ã€ã«ã¯ãããããã®ã§ããã
/etc/mysql/debian-start
exit 0
/etc/mysql/debian.cnf
[client]
host = localhost
user = debian-sys-maint
socket = /var/run/mysqld/mysqld.sock
[mysql_upgrade]
host = localhost
user = debian-sys-maint
socket = /var/run/mysqld/mysqld.sock
ä»ã®ãã¡ã€ã«ã確èªããŠã¿ãŸãããã
/etc/mysql/my.cnf
$ grep -v '#' /etc/mysql/my.cnf
!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mysql.conf.d/
/etc/mysql/mysql.cnf
$ grep -v '#' /etc/mysql/mysql.cnf
!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mysql.conf.d/
äžèº«ãåãã§ã¯ïŒãšæãããããã§ãããå®äœã¯mysql.cnfã§ããã
$ ll /etc/alternatives/my.cnf
lrwxrwxrwx 1 root root 20 Oct 31 19:25 /etc/alternatives/my.cnf -> /etc/mysql/mysql.cnf
å®éã®ä¿®æ£ã¯ã/etc/mysql/conf.dãã£ã¬ã¯ããªãŒããã³/etc/mysql/mysql.conf.dãã£ã¬ã¯ããªãŒã®äžèº«ã«å¯ŸããŠè¡ãã®ã
ããã§ããããèªã¿èŸŒãé çªã¯/etc/mysql/conf.d â /etc/mysql/mysql.conf.dã§ããã
/etc/mysql/conf.dãã£ã¬ã¯ããªãŒé
äžã¯ã¯ã©ã€ã¢ã³ãåãã®ãã¡ã€ã«ã§ããã
/etc/mysql/conf.d/mysql.cnf
$ grep -v '#' /etc/mysql/conf.d/mysql.cnf
[mysql]
/etc/mysql/conf.d/mysqldump.cnf
$ grep -v '#' /etc/mysql/conf.d/mysqldump.cnf
[mysqldump]
quick
quote-names
max_allowed_packet = 16M
/etc/mysql/mysql.conf.dãã£ã¬ã¯ããªãŒã«ã¯ãMySQLã¯ã©ã€ã¢ã³ãåããMySQLãµãŒããŒåãã®èšå®ãã¡ã€ã«ããããŸãã
/etc/mysql/mysql.conf.d/mysql.cnf
$ grep -v '#' /etc/mysql/mysql.conf.d/mysql.cnf
[mysql]
/etc/mysql/mysql.conf.d/mysqld.cnf
$ grep -v '#' /etc/mysql/mysql.conf.d/mysqld.cnf
[mysqld]
user = mysql
bind-address = 127.0.0.1
mysqlx-bind-address = 127.0.0.1
key_buffer_size = 16M
myisam-recover-options = BACKUP
log_error = /var/log/mysql/error.log
max_binlog_size = 100M
MySQLãµãŒããŒåãã®èšå®ã8.4ã®é ãšæ¯ã¹ããšå°ãªããªã£ãŠããŸããã
ããã©ã«ãå€ãå€ãã£ãŠããããã§ã¯ãªãããã§ããã
MySQL localhost SQL > show variables like 'pid_file';
+
| Variable_name | Value |
+
| pid_file | /var/lib/mysql/server.pid |
+
1 row in set (0.0018 sec)
MySQL localhost SQL > show variables like 'socket';
+
| Variable_name | Value |
+
| socket | /var/run/mysqld/mysqld.sock |
+
1 row in set (0.0012 sec)
MySQL localhost SQL > show variables like 'datadir';
+
| Variable_name | Value |
+
| datadir | /var/lib/mysql/ |
+
1 row in set (0.0017 sec)
MySQL localhost SQL > show variables like 'log_error';
+
| Variable_name | Value |
+
| log_error | /var/log/mysql/error.log |
+
1 row in set (0.0031 sec)
ä»åã¯ããããèšå®ã«ããŠãããŸããã
[mysqld]
user = mysql
bind-address = 0.0.0.0
mysqlx-bind-address = 0.0.0.0
key_buffer_size = 16M
myisam-recover-options = BACKUP
log_error = /var/log/mysql/error.log
character_set_server = utf8mb4
collation_server = utf8mb4_0900_bin
transaction_isolation = READ-COMMITTED
gtid_mode = on
enforce_gtid_consistency = on
log_bin = on
binlog_expire_logs_seconds = 864000
max_binlog_size = 100M
æžãããŠããå€ã¯ãããã©ã«ãå€ããã®ãŸãŸã«ãããã¡ãã£ãšè¿œå ã»å€æŽãããã®ã§ãã
ãã®ä»ã®èšå®é
ç®ã¯ãããã¥ã¡ã³ãã®ä»¥äžã®ããŒãžãèŠãŠãããšããã§ãããããã¹ãŠã®èšå®é
ç®ãã²ãšã€ã®ããŒãžã«
ãŸãšãŸã£ãŠããããã§ã¯ãªãã®ã§ããªã³ã¯ããŸãšããŠãããŸãããã
MySQL :: MySQL 9.7 Reference Manual :: 7.1.5 Server System Variable Reference
MySQL :: MySQL 9.7 Reference Manual :: 17.14 InnoDB Startup Options and System Variables
MySQL :: MySQL 9.7 Reference Manual :: 19.1.6.1 Replication and Binary Logging Option and Variable Reference
MySQL :: MySQL 9.7 Reference Manual :: 19.1.6.4 Binary Logging Options and Variables
MySQL :: MySQL 9.7 Reference Manual :: 19.1.6.5 Global Transaction ID System Variables
MySQL :: MySQL 9.7 Reference Manual :: 19.1.6.2 Replication Source Options and Variables
MySQL :: MySQL 9.7 Reference Manual :: 19.1.6.3 Replica Server Options and Variables
ã€ã³ã¹ããŒã«ããMySQLã®ããŒãžã§ã³ãCLIã§æå®ãã
以åã«ãããããšã³ããªãŒãæžããŠããã®ã§ãããMySQL 9.7ã§èŠããšå
容ãå€ãã£ãŠããã®ã§ããã§ãããããŠæžãããšã«
ããŸããã
MySQLをaptリポジトリーからインストールする時に、MySQL 8.0が選択されるように設定する - CLOVER🍀
GUIã§éžæããå Žåã¯ã以äžã®ã³ãã³ãã䜿ãããšã§æåã®éžæç»é¢ãåŒã³åºãããšãã§ããŸãã
$ sudo dpkg-reconfigure mysql-apt-config
MySQL :: MySQL 9.7 Reference Manual :: 2.5.2 Installing MySQL on Linux Using the MySQL APT Repository
CLIã§ã¯ããŸã以äžã®ã³ãã³ãã§çŸåšã®ç¶æ
ã確èªã§ããŸãã
$ sudo debconf-get-selections | grep mysql
mysql-apt-config mysql-apt-config/connectors-component string mysql-tools
mysql-apt-config mysql-apt-config/repo-codename select resolute
mysql-apt-config mysql-apt-config/repo-distro select ubuntu
mysql-apt-config mysql-apt-config/repo-url string http://repo.mysql.com/apt
mysql-apt-config mysql-apt-config/select-connectors select Enabled
mysql-apt-config mysql-apt-config/select-product select Ok
mysql-apt-config mysql-apt-config/select-server select mysql-9.7-lts
mysql-apt-config mysql-apt-config/unsupported-platform select abort
mysql-server mysql-server/installation_freeze_mode_active note
mysql-server mysql-server/nis_warning note
mysql-server mysql-server/no_upgrade_when_using_ndb error
mysql-server mysql-server/old_mariadb_data_directory_saved note
mysql-server mysql-server/password_mismatch error
mysql-server mysql-server/postrm_remove_databases boolean false
mysql-server mysql-server/root_password password
mysql-server mysql-server/root_password_again password
debconf-get-selectionsã³ãã³ããã€ã³ã¹ããŒã«ãããŠããªãå Žåã¯ãdebconf-utilsããã±ãŒãžãã€ã³ã¹ããŒã«ããŸãã
$ sudo apt install debconf-utils
ããšãã°MySQL 8.4ãéžæããå Žåã
$ echo 'mysql-apt-config mysql-apt-config/select-server select mysql-8.4-lts' | sudo debconf-set-selections
å€ãå€ãããŸãããã
$ sudo debconf-get-selections | grep mysql-apt-config/select-server
mysql-apt-config mysql-apt-config/select-server select mysql-8.4-lts
MySQL 9.7ã«æ»ããŠãããŸãããã
$ echo 'mysql-apt-config mysql-apt-config/select-server select mysql-9.7-lts' | sudo debconf-set-selections
å°ããªãã±ã§ãããrootãã¹ã¯ãŒããèšå®ããå Žåã®é
ç®åãå€ãã£ãŠããŸããã
mysql-server mysql-server/root_password password
mysql-server mysql-server/root_password_again password
詊ãã«èšå®ããŠã¿ãŸããããrootã®ãã¹ã¯ãŒãããmypasswordãã«ããŠã¿ãŸãã
$ echo 'mysql-server mysql-server/root_password password mypassword' | sudo debconf-set-selections
$ echo 'mysql-server mysql-server/root_password_again password mypassword' | sudo debconf-set-selections
MySQLãµãŒããŒã®ã€ã³ã¹ããŒã«ã
$ sudo DEBIAN_FRONTEND=noninteractive apt install mysql-server
DEBIAN_FRONTEND=noninteractiveãã€ããããšã§ã察話圢åŒã§ã¯ãªããªããŸãã
ããã§ãèšå®ãããã¹ã¯ãŒãã䜿ã£ãŠrootã§å
¥ããããã«ãªããŸãã
$ mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.4.11-0ubuntu0.26.04.1 (Ubuntu)
Copyright (c) 2000, 2026, Oracle and/or its affiliates.
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>
error.logäžã®è¡šèšã¯å€ãããªãããã§ããã
2026-10-31T11:49:07.463394Z 6 [Warning] [MY-010453] [Server] root@localhost is created with an empty password ! Please consider switching off the --initialize-insecure option.
ãŸããããèŠããšrootã¢ã«ãŠã³ãã¯UNIXãã¡ã€ã³ãœã±ããã䜿ã£ãOSã¢ã«ãŠã³ãã®èªèšŒã®æ¹ãããã®ã§ããããã
ãããã«
Ubuntu Linux 26.04 LTSã«MySQL 9.7ãã€ã³ã¹ããŒã«ããŠã¿ãŸããã
MySQLãµãŒããŒã®ã€ã³ã¹ããŒã«èªäœã§å°ãããšã¯ãªãã®ã§ããããã以å€ããããããšå€ãã£ãŠããŠã¡ãã£ãšé©ããŸãããã
ããããã¯MySQL 9.7ã䜿ã£ãŠãããŸãããã