config.html 4.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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>
  22. <b>Connection limits</b>
  23. <div class="gf-form-group">
  24. <div class="gf-form max-width-15">
  25. <span class="gf-form-label width-7">Max open</span>
  26. <input type="number" min="0" class="gf-form-input" ng-model="ctrl.current.jsonData.maxOpenConns" placeholder="unlimited"></input>
  27. <info-popover mode="right-absolute">
  28. The maximum number of open connections to the database. If <i>Max idle connections</i> is greater than 0 and the
  29. <i>Max open connections</i> is less than <i>Max idle connections</i>, then <i>Max idle connections</i> will be
  30. reduced to match the <i>Max open connections</i> limit. If set to 0, there is no limit on the number of open
  31. connections.
  32. </info-popover>
  33. </div>
  34. <div class="gf-form max-width-15">
  35. <span class="gf-form-label width-7">Max idle</span>
  36. <input type="number" min="0" class="gf-form-input" ng-model="ctrl.current.jsonData.maxIdleConns" placeholder="2"></input>
  37. <info-popover mode="right-absolute">
  38. The maximum number of connections in the idle connection pool. If <i>Max open connections</i> is greater than 0 but
  39. less than the <i>Max idle connections</i>, then the <i>Max idle connections</i> will be reduced to match the
  40. <i>Max open connections</i> limit. If set to 0, no idle connections are retained.
  41. </info-popover>
  42. </div>
  43. <div class="gf-form max-width-15">
  44. <span class="gf-form-label width-7">Max lifetime</span>
  45. <input type="number" min="0" class="gf-form-input" ng-model="ctrl.current.jsonData.connMaxLifetime" placeholder="14400"></input>
  46. <info-popover mode="right-absolute">
  47. The maximum amount of time in seconds a connection may be reused. If set to 0, connections are reused forever.
  48. </info-popover>
  49. </div>
  50. </div>
  51. <h3 class="page-heading">MySQL details</h3>
  52. <div class="gf-form-group">
  53. <div class="gf-form-inline">
  54. <div class="gf-form">
  55. <span class="gf-form-label width-9">Min time interval</span>
  56. <input type="text" class="gf-form-input width-6" ng-model="ctrl.current.jsonData.timeInterval" spellcheck='false' placeholder="1m"></input>
  57. <info-popover mode="right-absolute">
  58. A lower limit for the auto group by time interval. Recommended to be set to write frequency,
  59. for example <code>1m</code> if your data is written every minute.
  60. </info-popover>
  61. </div>
  62. </div>
  63. </div>
  64. <div class="gf-form-group">
  65. <div class="grafana-info-box">
  66. <h5>User Permission</h5>
  67. <p>
  68. The database user should only be granted SELECT permissions on the specified database &amp; tables you want to query.
  69. Grafana does not validate that queries are safe so queries can contain any SQL statement. For example, statements
  70. like <code>USE otherdb;</code> and <code>DROP TABLE user;</code> would be executed. To protect against this we
  71. <strong>Highly</strong> recommmend you create a specific MySQL user with restricted permissions.
  72. Checkout the <a class="external-link" target="_blank" href="http://docs.grafana.org/features/datasources/mysql/">MySQL Data Source Docs</a> for more information.
  73. </p>
  74. </div>
  75. </div>