Skip to content

Add support for MySQL service file for connect() #121

Open
@mileib

Description

@mileib

Unlike the PostgreSQL interface (which works fine), the MySQL interface does not seem to support a services file as there is no call to mysql_options(conn, MYSQL_READ_DEFAULT_GROUP, servicename); anywhere in the current ls_mysql.c code.

If I have MYSQL_HOME set in the environment and issue a connect with "service=foobar" when I invoke luasql, the connection information in the my.cnf file located in MYSQL_HOME for connection foobar should be parsed and used.

That is the only thing I should have to specify on the connection string and all the other required options will be pulled from the file under the foobar connection settings.

If I try this with the current code, it doesn't work and I receive

"Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)"

If I hack up the connect function and use mysql_options() as described above, it works fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions