```
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')
```
ErrorCodes::UNKNOWN_ELEMENT_IN_AST);
    if (engine_name == "Ordinary")
        return std::make_shared<DatabaseOrdinary>(database_name, metadata_path, context);
    else if (engine_name == "Atomic")
        return std::make_shared<DatabaseAtomic>(database_name, metadata_path, uuid, context);
    else if (engine_name == "Memory")
        return std::make_shared<DatabaseMemory>(database_name, context);
    else if (engine_name == "Dictionary")
        return std::make_shared<DatabaseDictionary>(database_name, context);
#if USE_MYSQL
    else if (engine_name == "MySQL" || engine_name == "MaterializeMySQL")
    {
        const ASTFunction * engine = engine_define->engine;
        if (!engine->arguments || engine->arguments->children.size() != 4)
            throw Exception(
                engine_name + " Database require mysql_hostname, mysql_database_name, mysql_username, mysql_password arguments.",
                ErrorCodes::BAD_ARGUMENTS);
        ASTs & arguments = engine->arguments->children;
        arguments[1] = evaluateConstantExpressionOrIdentifierAsLiteral(arguments[1], context);
        const auto & host_name_and_port = safeGetLiteralValue<String>(arguments[0], engine_name);
        const auto & mysql_database_name = safeGetLiteralValue<String>(arguments[1], engine_name);
        const auto & mysql_user_name = safeGetLiteralValue<String>(arguments[2], engine_name);
        const auto & mysql_user_password = safeGetLiteralValue<String>(arguments[3], engine_name);
        try
        {
            const auto & [remote_host_name, remote_port] = parseAddress(host_name_and_port, 3306);
            auto mysql_pool = mysqlxx::Pool(mysql_database_name, remote_host_name, mysql_user_name, mysql_user_password, remote_port);
            if (engine_name == "MaterializeMySQL")
            {
                MySQLClient client(remote_host_name, remote_port, mysql_user_name, mysql_user_password);