Search code examples
javamysqlscalajdbcmysql-workbench

MySQL connection with advanced attributes such as program_name


When I create a new connection to MySQL data base through mysql jdbc driver I see next advanced attributes in my MySQL Workbench:

enter image description here

We can see next attributes:

  • _runtime_version
  • _client_version
  • _client_name
  • _client_license
  • _runtime_vendor

How we manage these attributes?

Connection that was created by MySQL Workbench has other attributes: enter image description here

How can I set the 'program_name' attribute while connection creation or my own attributes?


Solution

  • The answer was found in this article Connection attributes in MySQL 5.6

    There is example of url with additional attributes:

    jdbc:mysql://localhost/login?connectionAttributes=program_name:Login Server,other_name:other
    

    enter image description here