MySQL 8.4 发行说明
给定一个路径名,按照以下顺序替换与以下系统变量值匹配的子路径后,返回修改后的路径名
datadir
tmpdir
replica_load_tmpdir
innodb_data_home_dir
innodb_log_group_home_dir
innodb_undo_directory
basedir
与系统变量 sysvar
的值匹配的值将替换为字符串 @@GLOBAL.
。sysvar
mysql> SELECT sys.format_path('/usr/local/mysql/data/world/City.ibd');
+---------------------------------------------------------+
| sys.format_path('/usr/local/mysql/data/world/City.ibd') |
+---------------------------------------------------------+
| @@datadir/world/City.ibd |
+---------------------------------------------------------+