```
Caught exception while loading metadata: Code: 501, e.displayText() = DB::Exception: Cannot create MySQL database, because Code: 393, e.displayText() 
= DB::Exception: There is no query, Stack trace (when copying this message, always include the lines below):

0. /home/milovidov/ClickHouse/build_gcc9/../contrib/poco/Foundation/src/Exception.cpp:27: Poco::Exception::Exception(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, 
int) @ 0x1074687c in /usr/bin/clickhouse
1. /home/milovidov/ClickHouse/build_gcc9/../src/Common/Exception.cpp:37: DB::Exception::Exception(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int) @ 0x7867c29 in
 /usr/bin/clickhouse
2. /home/milovidov/ClickHouse/build_gcc9/../contrib/libcxx/include/string:2134: DB::Context::getQueryContext() const (.cold) @ 0xd202416 in /usr/bin/clickhouse
3. /home/milovidov/ClickHouse/build_gcc9/../src/Interpreters/Context.h:457: DB::DatabaseConnectionMySQL::DatabaseConnectionMySQL(DB::Context const&, std::__1::basic_string<char, std::__1::char_traits<char>, std:
:__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, DB::ASTStorage const*, std::__1::basic_string<char, std::__1::char_traits<char>, std:
:__1::allocator<char> > const&, mysqlxx::Pool&&) @ 0xd408d7c in /usr/bin/clickhouse
```

```
ATTACH DATABASE conv_main
ENGINE = MySQL('hostname:3306', 'db', 'metrika', 'password')
```
const ASTStorage * database_engine_define_, const String & database_name_in_mysql_, mysqlxx::Pool && pool)
    : IDatabase(database_name_)
    , global_context(context.getGlobalContext())
    , metadata_path(metadata_path_)
    , database_engine_define(database_engine_define_->clone())
    , database_name_in_mysql(database_name_in_mysql_)
    , mysql_datatypes_support_level(context.getQueryContext().getSettingsRef().mysql_datatypes_support_level)
    , mysql_pool(std::move(pool))
{
    empty(); 
    thread = ThreadFromGlobalPool{&DatabaseConnectionMySQL::cleanOutdatedTables, this};
}
bool DatabaseConnectionMySQL::empty() const
{
    std::lock_guard<std::mutex> lock(mutex);
    fetchTablesIntoLocalCache(global_context);
    if (local_tables_cache.empty())
        return true;
    for (const auto & [table_name, storage_info] : local_tables_cache)
        if (!remove_or_detach_tables.count(table_name))
            return false;
    return true;
}
DatabaseTablesIteratorPtr DatabaseConnectionMySQL::getTablesIterator(const Context & context, const FilterByNameFunction & filter_by_table_name)