Wiki source code of MySQL Tips
Last modified by christoph_lechleitner@iteg_at on 2013-02-08 03.13:19
Hide last authors
| author | version | line-number | content |
|---|---|---|---|
| |
1.1 | 1 | = {{id name="MySQLTips-InstallingandusingMySQLdriverinLinux"/}}Installing and using MySQL driver in Linux = |
| 2 | |||
| 3 | {{code language="none"}} | ||
| 4 | apt-get install libmysql-java | ||
| 5 | |||
| 6 | jdbc2xml ... --jdbc-drivers /usr/share/java/mysql-connector-java.jar | ||
| 7 | {{/code}} | ||
| 8 | |||
| 9 | = {{id name="MySQLTips-OptimizingINSERTperformance"/}}Optimizing INSERT performance = | ||
| 10 | |||
| 11 | Unfortunately mysqld can be quite slow when INSERTing large numbers of rows. | ||
| 12 | |||
| 13 | (% style="font-size: 10.0pt;line-height: 13.0pt;" %)We found the hint from (%%)[[this Stackoverflow article>>url:http://stackoverflow.com/questions/6937443/query-end-step-very-long-at-random-times||style="font-size: 10.0pt;line-height: 13.0pt;" shape="rect"]] quite effective: | ||
| 14 | |||
| 15 | The ##[[innodb_flush_log_at_trx_commit>>url:http://dev.mysql.com/doc/refman/5.1/en/innodb-parameters.html#sysvar_innodb_flush_log_at_trx_commit||shape="rect"]]## setting should be set to 2 (in the {{code language="none"}}[mysqld]{{/code}} section of {{code language="none"}}my.cnf{{/code}}): | ||
| 16 | |||
| 17 | {{code language="none"}} | ||
| 18 | [mysqld] | ||
| 19 | # ... | ||
| 20 | innodb_flush_log_at_trx_commit = 2 | ||
| 21 | {{/code}} | ||
| 22 | |||
| 23 | Unfortunaltely the MySQL server has to be restarted for this change to take effect. | ||
| 24 | |||
| 25 |