Documentation Home
MySQL 5.7 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 38.2Mb
PDF (A4) - 38.2Mb
PDF (RPM) - 37.1Mb
HTML Download (TGZ) - 10.1Mb
HTML Download (Zip) - 10.2Mb
HTML Download (RPM) - 8.9Mb
Man Pages (TGZ) - 206.2Kb
Man Pages (Zip) - 314.5Kb
Info (Gzip) - 3.5Mb
Info (Zip) - 3.5Mb
Excerpts from this Manual

MySQL 5.7 Reference Manual  /  ...  /  The extract_schema_from_file_name() Function The extract_schema_from_file_name() Function

Given a file path name, returns the path component that represents the schema name. This function assumes that the file name lies within the schema directory. For this reason, it will not work with partitions or tables defined using their own DATA_DIRECTORY table option.

This function is useful when extracting file I/O information from the Performance Schema that includes file path names. It provides a convenient way to display schema names, which can be more easily understood than full path names, and can be used in joins against object schema names.

  • path VARCHAR(512): The full path to a data file from which to extract the schema name.

Return Value

A VARCHAR(64) value.

mysql> SELECT extract_schema_from_file_name('/usr/local/mysql/data/world/City.ibd');
| extract_schema_from_file_name('/usr/local/mysql/data/world/City.ibd') |
| world                                                                 |

User Comments
Sign Up Login You must be logged in to post a comment.