Skip to content

Connect .NET to SQLEye

Use Npgsql for PostgreSQL and MySqlConnector for MySQL, with host 127.0.0.1, the instance’s port and no password. Create the database first, see CLI clients.

Npgsql keys are Host, Port, Username, Password and Database, separated by semicolons.

Host=127.0.0.1;Port=5432;Username=postgres;Database=myapp

MySqlConnector accepts Server, Port, User ID, Password and Database. The password defaults to blank.

Server=127.0.0.1;Port=3306;User ID=root;Database=myapp

Replace the port with your instance’s port. Put the string in appsettings.json under ConnectionStrings or pass it to your provider as usual.

Sources: Npgsql connection string parameters, MySqlConnector connection options. To see the queries your code sends, turn on capture.

SQLEye is developed and maintained by CodeROG. This page is also available as Markdown.