Description:
When we set innodb_data_file_path as follow:
user = mysql
datadir = /var/lib/mysql
innodb_data_home_dir = /var/lib/INNODB
innodb_data_file_path = INNODBDATA:64M:autoextend
mysql throw an error message like below:
2023-02-17T13:39:46.419879Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.32-0ubuntu0.22.04.2) starting as process 2297
2023-02-17T13:39:46.425349Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2023-02-17T13:39:46.455377Z 1 [ERROR] [MY-012592] [InnoDB] Operating system error number 2 in a file operation.
2023-02-17T13:39:46.455409Z 1 [ERROR] [MY-012593] [InnoDB] The error means the system cannot find the path specified.
2023-02-17T13:39:46.455417Z 1 [ERROR] [MY-012594] [InnoDB] If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them.
2023-02-17T13:39:46.455426Z 1 [ERROR] [MY-012646] [InnoDB] File /var/lib/INNODB/INNODBDATA: 'open' returned OS error 71. Cannot continue operation
2023-02-17T13:39:46.455433Z 1 [ERROR] [MY-012981] [InnoDB] Cannot continue operation.
2023-02-17T13:39:46.949167Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.0.32-0ubuntu0.22.04.2) starting as process 2321
2023-02-17T13:39:46.954890Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
I tried to create a directory with mysql user in "/var/lib/mysql" as well as outside the "/var/lib/mysql" but no success, still coming error messages.
The MySQL data directory contains as follows:
root@intranet:/var/lib/mysql# ls -l
total 78292
-rw-r----- 1 mysql mysql 56 Feb 17 13:36 auto.cnf
-rw-r----- 1 mysql mysql 180 Feb 17 13:37 binlog.000001
-rw-r----- 1 mysql mysql 404 Feb 17 13:37 binlog.000002
-rw-r----- 1 mysql mysql 180 Feb 17 13:37 binlog.000003
-rw-r----- 1 mysql mysql 48 Feb 17 13:37 binlog.index
-rw------- 1 mysql mysql 1705 Feb 17 13:36 ca-key.pem
-rw-r--r-- 1 mysql mysql 1112 Feb 17 13:36 ca.pem
-rw-r--r-- 1 mysql mysql 1112 Feb 17 13:36 client-cert.pem
-rw------- 1 mysql mysql 1705 Feb 17 13:36 client-key.pem
-rw-r--r-- 1 root root 0 Feb 17 13:37 debian-5.7.flag
-rw-r----- 1 mysql mysql 196608 Feb 17 13:37 '#ib_16384_0.dblwr'
-rw-r----- 1 mysql mysql 8585216 Feb 17 13:36 '#ib_16384_1.dblwr'
-rw-r----- 1 mysql mysql 3410 Feb 17 13:37 ib_buffer_pool
-rw-r----- 1 mysql mysql 12582912 Feb 17 13:37 ibdata1
drwxrwxr-x 2 mysql mysql 4096 Feb 17 13:39 INNODB
drwxr-x--- 2 mysql mysql 4096 Feb 17 13:37 '#innodb_redo'
drwxr-x--- 2 mysql mysql 4096 Feb 17 13:37 '#innodb_temp'
drwxr-x--- 2 mysql mysql 4096 Feb 17 13:36 mysql
-rw-r----- 1 mysql mysql 25165824 Feb 17 13:37 mysql.ibd
drwxr-x--- 2 mysql mysql 4096 Feb 17 13:36 performance_schema
-rw------- 1 mysql mysql 1705 Feb 17 13:36 private_key.pem
-rw-r--r-- 1 mysql mysql 452 Feb 17 13:36 public_key.pem
-rw-r--r-- 1 mysql mysql 1112 Feb 17 13:36 server-cert.pem
-rw------- 1 mysql mysql 1705 Feb 17 13:36 server-key.pem
drwxr-x--- 2 mysql mysql 4096 Feb 17 13:36 sys
-rw-r----- 1 mysql mysql 16777216 Feb 17 13:37 undo_001
-rw-r----- 1 mysql mysql 16777216 Feb 17 13:37 undo_002
How to repeat:
Basic installation of the Ubuntu server. There aren't any extra package, just install the MySQL Server.