config.html 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <h3 class="page-heading">MySQL Connection</h3>
  2. <div class="gf-form-group">
  3. <div class="gf-form max-width-30">
  4. <span class="gf-form-label width-7">Host</span>
  5. <input type="text" class="gf-form-input" ng-model='ctrl.current.url' placeholder="localhost:3306" bs-typeahead="{{['localhost:3306', 'localhost:3307']}}" required></input>
  6. </div>
  7. <div class="gf-form max-width-30">
  8. <span class="gf-form-label width-7">Database</span>
  9. <input type="text" class="gf-form-input" ng-model='ctrl.current.database' placeholder="database name" required></input>
  10. </div>
  11. <div class="gf-form-inline">
  12. <div class="gf-form max-width-15">
  13. <span class="gf-form-label width-7">User</span>
  14. <input type="text" class="gf-form-input" ng-model='ctrl.current.user' placeholder="user"></input>
  15. </div>
  16. <div class="gf-form max-width-15">
  17. <span class="gf-form-label width-7">Password</span>
  18. <input type="password" class="gf-form-input" ng-model='ctrl.current.password' placeholder="password"></input>
  19. </div>
  20. </div>
  21. <div class="gf-form-group">
  22. <div class="gf-form-inline">
  23. <gf-form-checkbox class="gf-form" label="TLS Client Auth" label-class="width-10"
  24. checked="ctrl.current.jsonData.tlsAuth" switch-class="max-width-6"></gf-form-checkbox>
  25. <gf-form-checkbox class="gf-form" label="With CA Cert" tooltip="Needed for
  26. verifing self-signed TLS Certs" checked="ctrl.current.jsonData.tlsAuthWithCACert" label-class="width-11"
  27. switch-class="max-width-6"></gf-form-checkbox>
  28. </div>
  29. <div class="gf-form-inline">
  30. <gf-form-checkbox class="gf-form" label="Skip TLS Verify" label-class="width-10"
  31. checked="ctrl.current.jsonData.tlsSkipVerify" switch-class="max-width-6"></gf-form-checkbox>
  32. </div>
  33. </div>
  34. <datasource-tls-auth-settings current="ctrl.current" ng-if="(ctrl.current.jsonData.tlsAuth || ctrl.current.jsonData.tlsAuthWithCACert)">
  35. </datasource-tls-auth-settings>
  36. <b>Connection limits</b>
  37. <div class="gf-form-group">
  38. <div class="gf-form max-width-15">
  39. <span class="gf-form-label width-7">Max open</span>
  40. <input type="number" min="0" class="gf-form-input" ng-model="ctrl.current.jsonData.maxOpenConns" placeholder="unlimited"></input>
  41. <info-popover mode="right-absolute">
  42. The maximum number of open connections to the database. If <i>Max idle connections</i> is greater than 0 and the
  43. <i>Max open connections</i> is less than <i>Max idle connections</i>, then <i>Max idle connections</i> will be
  44. reduced to match the <i>Max open connections</i> limit. If set to 0, there is no limit on the number of open
  45. connections.
  46. </info-popover>
  47. </div>
  48. <div class="gf-form max-width-15">
  49. <span class="gf-form-label width-7">Max idle</span>
  50. <input type="number" min="0" class="gf-form-input" ng-model="ctrl.current.jsonData.maxIdleConns" placeholder="2"></input>
  51. <info-popover mode="right-absolute">
  52. The maximum number of connections in the idle connection pool. If <i>Max open connections</i> is greater than 0 but
  53. less than the <i>Max idle connections</i>, then the <i>Max idle connections</i> will be reduced to match the
  54. <i>Max open connections</i> limit. If set to 0, no idle connections are retained.
  55. </info-popover>
  56. </div>
  57. <div class="gf-form max-width-15">
  58. <span class="gf-form-label width-7">Max lifetime</span>
  59. <input type="number" min="0" class="gf-form-input" ng-model="ctrl.current.jsonData.connMaxLifetime" placeholder="14400"></input>
  60. <info-popover mode="right-absolute">
  61. The maximum amount of time in seconds a connection may be reused. If set to 0, connections are reused forever.<br/><br/>
  62. This should always be lower than configured <a href="https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_wait_timeout" target="_blank">wait_timeout</a> in MySQL.
  63. </info-popover>
  64. </div>
  65. </div>
  66. <h3 class="page-heading">MySQL details</h3>
  67. <div class="gf-form-group">
  68. <div class="gf-form-inline">
  69. <div class="gf-form">
  70. <span class="gf-form-label width-9">Min time interval</span>
  71. <input type="text" class="gf-form-input width-6" ng-model="ctrl.current.jsonData.timeInterval" spellcheck='false' placeholder="1m"></input>
  72. <info-popover mode="right-absolute">
  73. A lower limit for the auto group by time interval. Recommended to be set to write frequency,
  74. for example <code>1m</code> if your data is written every minute.
  75. </info-popover>
  76. </div>
  77. </div>
  78. </div>
  79. <div class="gf-form-group">
  80. <div class="grafana-info-box">
  81. <h5>User Permission</h5>
  82. <p>
  83. The database user should only be granted SELECT permissions on the specified database &amp; tables you want to query.
  84. Grafana does not validate that queries are safe so queries can contain any SQL statement. For example, statements
  85. like <code>USE otherdb;</code> and <code>DROP TABLE user;</code> would be executed. To protect against this we
  86. <strong>Highly</strong> recommmend you create a specific MySQL user with restricted permissions.
  87. Checkout the <a class="external-link" target="_blank" href="http://docs.grafana.org/features/datasources/mysql/">MySQL Data Source Docs</a> for more information.
  88. </p>
  89. </div>
  90. </div>