GA

2026/12/01

今年もConoHa VPSでMySQLをビルドする2026年

この記事は ConoHa - Qiita Advent Calendar 2026 の1日目の記事です。

今年は ConoHa VPS(Ver.3.0) のメモリ 2GB/CPU 3Coreプランで試してみました。

OSはRocky Linux 10にしました。


$ cat /etc/os-release

NAME="Rocky Linux"

VERSION="10.3 (Red Quartz)"

RELEASE_TYPE="stable"

ID="rocky"

ID_LIKE="rhel centos fedora"

VERSION_ID="10.3"

PLATFORM_ID="platform:el10"

PRETTY_NAME="Rocky Linux 10.3 (Red Quartz)"

ANSI_COLOR="0;32"

LOGO="fedora-logo-icon"

CPE_NAME="cpe:/o:rocky:rocky:10::baseos"

HOME_URL="https://rockylinux.org/"

VENDOR_NAME="RESF"

VENDOR_URL="https://resf.org/"

BUG_REPORT_URL="https://bugs.rockylinux.org/"

SUPPORT_END="2035-05-31"

ROCKY_SUPPORT_PRODUCT="Rocky-Linux-10"

ROCKY_SUPPORT_PRODUCT_VERSION="10.3"

REDHAT_SUPPORT_PRODUCT="Rocky Linux"

REDHAT_SUPPORT_PRODUCT_VERSION="10.3"

最新のMySQLは26.10.0.1です。

$ wget https://dev.mysql.com/get/Downloads/MySQL-26.10/mysql-26.10.0.1.tar.gz
--2026-11-30 18:49:07--  https://dev.mysql.com/get/Downloads/MySQL-26.10/mysql-26.10.0.1.tar.gz
Resolving dev.mysql.com (dev.mysql.com)... 2600:140b:ac00:2ae::2e31, 2600:140b:ac00:285::2e31, 184.27.161.219
Connecting to dev.mysql.com (dev.mysql.com)|2600:140b:ac00:2ae::2e31|:443... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://cdn.mysql.com//Downloads/MySQL-26.10/mysql-26.10.0.1.tar.gz [following]
--2026-11-30 18:49:08--  https://cdn.mysql.com//Downloads/MySQL-26.10/mysql-26.10.0.1.tar.gz
Resolving cdn.mysql.com (cdn.mysql.com)... 2600:140b:ac00:2a2::1d68, 2600:140b:ac00:2ac::1d68, 23.46.143.72
Connecting to cdn.mysql.com (cdn.mysql.com)|2600:140b:ac00:2a2::1d68|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 462667957 (441M) [application/x-tar-gz]
Saving to: ‘mysql-26.10.0.1.tar.gz’

mysql-26.10.0.1.tar.gz                  100%[=============================================================================>] 441.23M  11.2MB/s    in 38s

2026-11-30 18:49:46 (11.5 MB/s) - ‘mysql-26.10.0.1.tar.gz’ saved [462667957/462667957]

ビルドに時間がかかりそうなのでtmuxと様子見用のdstatだけ先に入れておきます。

$ sudo dnf install -y tmux dstat

趣味を含んだcmakeオプションで開始。

$ tar xf mysql-26.10.0.1.tar.gz
$ cd mysql-26.10.0.1/
$ cmake -DCMAKE_INSTALL_PREFIX=/usr/mysql/26.10.0.1 -DMINIMAL_RELWITHDEBINFO=OFF -DFORCE_INSOURCE_BUILD=1
-bash: cmake: command not found

cmakeをインストール。

$ sudo dnf install -y cmake

$ cmake -DCMAKE_INSTALL_PREFIX=/usr/mysql/26.10.0.1 -DMINIMAL_RELWITHDEBINFO=OFF -DFORCE_INSOURCE_BUILD=1
..
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:519 (PROJECT):
  No CMAKE_C_COMPILER could be found.

  Tell CMake where to find the compiler by setting either the environment
  variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
  the compiler, or to the compiler name if it is in the PATH.

CMake Error at CMakeLists.txt:519 (PROJECT):
  No CMAKE_CXX_COMPILER could be found.

  Tell CMake where to find the compiler by setting either the environment
  variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
  to the compiler, or to the compiler name if it is in the PATH.

-- Configuring incomplete, errors occurred!

C++のコンパイラが無かった。吊るしのg++でいいかしら。

$ sudo dnf install -y g++

$ cmake -DCMAKE_INSTALL_PREFIX=/usr/mysql/26.10.0.1 -DMINIMAL_RELWITHDEBINFO=OFF -DFORCE_INSOURCE_BUILD=1
..
-- Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR (missing: OPENSSL_CRYPTO_LIBRARY OPENSSL_INCLUDE_DIR)
--
Could not find system OpenSSL
Make sure you have specified a supported SSL version.
Valid options are :
openssl[0-9]+ (use alternative system library)
yes (synonym for system)
</path/to/custom/openssl/installation>

CMake Error at cmake/ssl.cmake:85 (MESSAGE):
  Please install the appropriate openssl developer package.

Call Stack (most recent call first):
  cmake/ssl.cmake:387 (FATAL_SSL_NOT_FOUND_ERROR)
  cmake/ssl.cmake:570 (FIND_SYSTEM_OPENSSL)
  CMakeLists.txt:1934 (MYSQL_CHECK_SSL)

-- Configuring incomplete, errors occurred!

openssl-develをインストール。

$ sudo dnf install -y openssl-devel

$ cmake -DCMAKE_INSTALL_PREFIX=/usr/mysql/26.10.0.1 -DMINIMAL_RELWITHDEBINFO=OFF -DFORCE_INSOURCE_BUILD=1
..
-- Could NOT find Curses (missing: CURSES_LIBRARY CURSES_INCLUDE_PATH)
CMake Error at cmake/readline.cmake:93 (MESSAGE):
  Curses library not found.  Please install appropriate package,

      remove CMakeCache.txt and rerun cmake.On Debian/Ubuntu, package name is libncurses5-dev, on Redhat and derivates it is ncurses-devel.
Call Stack (most recent call first):
  cmake/readline.cmake:127 (FIND_CURSES)
  cmake/readline.cmake:221 (MYSQL_USE_BUNDLED_EDITLINE)
  CMakeLists.txt:2041 (MYSQL_CHECK_EDITLINE)

-- Configuring incomplete, errors occurred!

ncurses-develもインストール。CMakeCache.txtを消せって書いてあるのでそうする。

$ sudo dnf install -y ncurses-devel
$ rm CMakeCache.txt

$ cmake -DCMAKE_INSTALL_PREFIX=/usr/mysql/26.10.0.1 -DMINIMAL_RELWITHDEBINFO=OFF -DFORCE_INSOURCE_BUILD=1
..
-- Could NOT find CURL (missing: CURL_LIBRARY CURL_INCLUDE_DIR)
-- CURL_INCLUDE_DIR =
CMake Error at cmake/curl.cmake:246 (ADD_LIBRARY):
  ADD_LIBRARY cannot create ALIAS target "ext::curl" because target
  "curl_interface" does not already exist.
Call Stack (most recent call first):
  CMakeLists.txt:2071 (MYSQL_CHECK_CURL)

CMake Warning at cmake/curl.cmake:71 (MESSAGE):
  Cannot find CURL development libraries.  You need to install the required
  packages:

    Debian/Ubuntu:              apt install libcurl4-openssl-dev
    RedHat/Fedora/Oracle Linux: yum install libcurl-devel
    SuSE:                       zypper install libcurl-devel

Call Stack (most recent call first):
  CMakeLists.txt:2074 (WARN_MISSING_SYSTEM_CURL)

CMake Error at CMakeLists.txt:2076 (MESSAGE):
  -DWITH_CURL=system, but missing system libraries.

  You can disable CURL with -DWITH_CURL=0

-- Configuring incomplete, errors occurred!

今度はlibcurl-devel。実は上にbisonが見つからないというのもあるけどこれはワーニングなので無視する。
昔っからだけどなんでncurses-develの時だけCMakeCache.txtを自分で消させられるんだろう。

$ sudo dnf install -y libcurl-devel

$ cmake -DCMAKE_INSTALL_PREFIX=/usr/mysql/26.10.0.1 -DMINIMAL_RELWITHDEBINFO=OFF -DFORCE_INSOURCE_BUILD=1
..

-- FIDO_VERSION (bundled) is 1.15.0
CMake Warning at cmake/fido2.cmake:70 (MESSAGE):
  Cannot find development libraries.  You need to install the required
  packages:

    Debian/Ubuntu:              apt install libudev-dev
    RedHat/Fedora/Oracle Linux: yum install libudev-devel
    SuSE:                       zypper install libudev-devel

Call Stack (most recent call first):
  CMakeLists.txt:2128 (WARN_MISSING_SYSTEM_UDEV)

CMake Error at CMakeLists.txt:2131 (MESSAGE):
  -DWITH_AUTHENTICATION_WEBAUTHN=ON, but missing required libraries

-- Configuring incomplete, errors occurred!

次はlibudev-devel

$ sudo dnf install -y libudev-devel

$ cmake -DCMAKE_INSTALL_PREFIX=/usr/mysql/26.10.0.1 -DMINIMAL_RELWITHDEBINFO=OFF -DFORCE_INSOURCE_BUILD=1

..
-- FIDO_VERSION (bundled) is 1.15.0
CMake Warning at cmake/fido2.cmake:70 (MESSAGE):
  Cannot find development libraries.  You need to install the required
  packages:

    Debian/Ubuntu:              apt install libudev-dev
    RedHat/Fedora/Oracle Linux: yum install libudev-devel
    SuSE:                       zypper install libudev-devel

Call Stack (most recent call first):
  CMakeLists.txt:2128 (WARN_MISSING_SYSTEM_UDEV)

CMake Error at CMakeLists.txt:2131 (MESSAGE):
  -DWITH_AUTHENTICATION_WEBAUTHN=ON, but missing required libraries

-- Configuring incomplete, errors occurred!

同じエラー。CMakeCache.txtの削除が必要かな。

$ rm CMakeCache.txt

$ cmake -DCMAKE_INSTALL_PREFIX=/usr/mysql/26.10.0.1 -DMINIMAL_RELWITHDEBINFO=OFF -DFORCE_INSOURCE_BUILD=1

..
-- Checking for module 'libtirpc'
--   Package 'libtirpc', required by 'virtual:world', not found
CMake Warning at cmake/rpc.cmake:41 (MESSAGE):
  Cannot find RPC development libraries.  You need to install the required
  packages:

    Debian/Ubuntu:              apt install libtirpc-dev
    RedHat/Fedora/Oracle Linux: yum install libtirpc-devel
    SuSE:                       zypper install glibc-devel

Call Stack (most recent call first):
  cmake/rpc.cmake:107 (WARN_MISSING_SYSTEM_TIRPC)
  CMakeLists.txt:2172 (MYSQL_CHECK_RPC)

CMake Error at cmake/rpc.cmake:108 (MESSAGE):
  Could not find rpc/rpc.h in /usr/include or /usr/include/tirpc
Call Stack (most recent call first):
  CMakeLists.txt:2172 (MYSQL_CHECK_RPC)

-- Configuring incomplete, errors occurred!

libtirpc-devel。例年リポジトリがわからなくなるやつ…。

$ sudo dnf install -y libtirpc-devel
Last metadata expiration check: 0:18:26 ago on Mon 30 Nov 2026 06:45:09 PM JST.
No match for argument: libtirpc-devel
Error: Unable to find a match: libtirpc-devel

Rocky Linux 10ではcrbでいいらしい。

$ sudo dnf install -y --enablerepo=crb libtirpc-devel

$ cmake -DCMAKE_INSTALL_PREFIX=/usr/mysql/26.10.0.1 -DMINIMAL_RELWITHDEBINFO=OFF -DFORCE_INSOURCE_BUILD=1

..
-- Performing Test X_PUTLONG_NOT_USE_CONST - Failed
CMake Warning at cmake/rpc.cmake:30 (MESSAGE):
  Cannot find rpcgen executable.  You need to install the required packages:

    Debian/Ubuntu:              apt install rpcsvc-proto
    RedHat/Fedora/Oracle Linux: yum install rpcgen
    SuSE:                       zypper install glibc-devel

Call Stack (most recent call first):
  plugin/group_replication/libmysqlgcs/cmake/rpcgen.cmake:123 (WARN_MISSING_RPCGEN_EXECUTABLE)
  plugin/group_replication/libmysqlgcs/CMakeLists.txt:51 (INCLUDE)

CMake Error at plugin/group_replication/libmysqlgcs/cmake/rpcgen.cmake:124 (MESSAGE):
  Could not find rpcgen
Call Stack (most recent call first):
  plugin/group_replication/libmysqlgcs/CMakeLists.txt:51 (INCLUDE)

-- Configuring incomplete, errors occurred!

そしてrpcgen。

$ sudo dnf install -y rpcgen

$ cmake -DCMAKE_INSTALL_PREFIX=/usr/mysql/26.10.0.1 -DMINIMAL_RELWITHDEBINFO=OFF -DFORCE_INSOURCE_BUILD=1

..
-- Could NOT find BISON (missing: BISON_EXECUTABLE)
CMake Warning at cmake/bison.cmake:119 (MESSAGE):
  No bison found!!
Call Stack (most recent call first):
  router/src/routing_guidelines/src/CMakeLists.txt:25 (INCLUDE)

CMake Warning at cmake/bison.cmake:120 (MESSAGE):
  If you have bison in a non-standard location, you can do 'cmake
  -DBISON_EXECUTABLE=</path/to/bison-executable>
Call Stack (most recent call first):
  router/src/routing_guidelines/src/CMakeLists.txt:25 (INCLUDE)

CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:233 (message):
  Could NOT find BISON (missing: BISON_EXECUTABLE)
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:603 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake/Modules/FindBISON.cmake:306 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  router/src/routing_guidelines/src/CMakeLists.txt:27 (FIND_PACKAGE)

-- Configuring incomplete, errors occurred!

あれ、いつの間にかbisonも必須になった…?

$ sudo dnf install -y bison

$ cmake -DCMAKE_INSTALL_PREFIX=/usr/mysql/26.10.0.1 -DMINIMAL_RELWITHDEBINFO=OFF -DFORCE_INSOURCE_BUILD=1

..
-- CMAKE_C_LINK_FLAGS:
-- CMAKE_CXX_LINK_FLAGS:
-- CMAKE_EXE_LINKER_FLAGS
-- CMAKE_MODULE_LINKER_FLAGS
-- CMAKE_SHARED_LINKER_FLAGS
-- Configuring done (1.9s)
-- Generating done (6.0s)
-- Build files have been written to: /home/yoku0825/mysql-26.10.0.1

無事にcmake完走。
メモリ2GB、swap2GBだとOOM Killerに殺されるかな? と思いつつ取り敢えずビルド。

$ time make -j$(nproc)

ガッツリ応答がなくなったので止めてからシングルスレッドで再ビルド。

^C^C^Cmake[2]: *** [storage/perfschema/CMakeFiles/perfschema.dir/build.make:2039: storage/perfschema/CMakeFiles/perfschema.dir/table_socket_summary_by_instanc
e.cc.o] Interrupt
make[2]: *** [sql/CMakeFiles/sql_gis.dir/build.make:93: sql/CMakeFiles/sql_gis.dir/gis/buffer.cc.o] Interrupt
make[1]: *** [CMakeFiles/Makefile2:25573: storage/perfschema/CMakeFiles/perfschema.dir/all] Interrupt
^Cmake: *** [Makefile:166: all] Interrupt

real    72m16.182s
user    63m51.529s
sys     3m40.919s

$ make
..

OOM Killerでbashごと落とされた…やはりswapが必要。

$ sudo dd if=/dev/zero of=/swapfile bs=10M count=1024
1024+0 records in
1024+0 records out
10737418240 bytes (11 GB, 10 GiB) copied, 11.8561 s, 906 MB/s

$ sudo mkswap /swapfile
mkswap: /swapfile: insecure permissions 0644, fix with: chmod 0600 /swapfile
Setting up swapspace version 1, size = 10 GiB (10737414144 bytes)
no label, UUID=ea5f2653-5590-4473-84b0-16bfded85ff7

$ sudo swapon /swapfile
swapon: /swapfile: insecure permissions 0644, 0600 suggested.

$ sudo chown 600 !$
sudo chown 600 /swapfile

$ swapon -s
Filename                                Type            Size            Used            Priority
/var/spool/swap/swapfile                file            2097148         85296           -2
/swapfile                               file            10485756        0               -3

やり直し…。

$ make
..
[100%] Building CXX object router/tests/mrs_client/CMakeFiles/mysqlrouter_mrs_client.dir/main.cc.o
[100%] Building CXX object router/tests/mrs_client/CMakeFiles/mysqlrouter_mrs_client.dir/client/http_client_request.cc.o
[100%] Building CXX object router/tests/mrs_client/CMakeFiles/mysqlrouter_mrs_client.dir/client/session.cc.o
[100%] Building CXX object router/tests/mrs_client/CMakeFiles/mysqlrouter_mrs_client.dir/client/authentication.cc.o
[100%] Linking CXX executable ../../../runtime_output_directory/mysqlrouter_mrs_client
[100%] Built target mysqlrouter_mrs_client

一晩経って完走。。

$ sudo make install
..

$ sudo groupadd mysql
$ sudo useradd mysql -g mysql

$ cd /usr/mysql/26.10.0.1/
$ sudo bin/mysqld --initialize --user=mysql
2026-12-01T06:22:08.006645Z 0 [System] [MY-015017] [Server] MySQL Server Initialization - start.
2026-12-01T06:22:08.009643Z 0 [System] [MY-013169] [Server] /usr/mysql/26.10.0.1/bin/mysqld (mysqld 26.10.0) initializing of server in progress as process 159224
2026-12-01T06:22:08.009651Z 0 [System] [MY-015150] [Server] Server version with update: '26.10.0.1'
2026-12-01T06:22:08.053429Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2026-12-01T06:22:08.697285Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2026-12-01T06:22:11.677077Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: dHyb<l2wj+r;
2026-12-01T06:22:14.587171Z 0 [System] [MY-015018] [Server] MySQL Server Initialization - end.

$ sudo bin/mysqld --daemonize --user=mysql
mysqld will log errors to /usr/mysql/26.10.0.1/data/vm-d8e3a9aa-c7.err
mysqld is running as pid 159349

$ bin/mysql -uroot -p
Enter password:

mysql> ALTER USER root@localhost IDENTIFIED BY 'New_password!';
Query OK, 0 rows affected (0.011 sec)

mysql> SELECT @@version, @@version_with_update;
+-----------+-----------------------+
| @@version | @@version_with_update |
+-----------+-----------------------+
| 26.10.0   | 26.10.0.1             |
+-----------+-----------------------+
1 row in set (0.000 sec)

今年も無事にビルドができました。
明日は @narikakun さんです。

​