Difference between revisions of "MySQL"

From OpenKM Documentation
Jump to: navigation, search
m
Line 25: Line 25:
  
 
{{Advice|[http://en.wikipedia.org/wiki/InnoDB InnoDB] is the preferred engine because it support transactions. [http://en.wikipedia.org/wiki/MyISAM MyISAM] is more responsive but does not support transactions.}}
 
{{Advice|[http://en.wikipedia.org/wiki/InnoDB InnoDB] is the preferred engine because it support transactions. [http://en.wikipedia.org/wiki/MyISAM MyISAM] is more responsive but does not support transactions.}}
 +
 +
== Database repair ==
 +
If you have problems with a database and need to be repaired, you can use this command:
 +
 +
  $ mysqlcheck -u root -p --auto-repair --optimize --all-databases
  
 
See also:
 
See also:

Revision as of 17:26, 22 January 2013

Download MySQL JDBC driver from MySQL Home Page and move it to $JBOSS_HOME/server/default/lib.


Nota clasica.png If you get an error like this:
Packet for query is too large (1708726 > 1048576).
You can change this value on the server by setting the 'max_allowed_packet' variable.
You need to modify your MySQL server configuration file and increase the value of the max_allowed_packet property. Don't forget to restart the MySQL after any change in this file. In Debian based distros like Ubuntu, this configuration file is located at /etc/mysql/my.cnf.

Change mysql default engine to InnoDB

Check if your MySQL installation has InnoDB engin enabled:

 $ mysql -h localhost -u root -p
 mysql> show engines;

In order to change the default storage engine edit /etc/mysql/my.cnf and under [mysqld] section in your ini file, and add:

 default-storage-engine = innodb

Nota idea.png InnoDB is the preferred engine because it support transactions. MyISAM is more responsive but does not support transactions.

Database repair

If you have problems with a database and need to be repaired, you can use this command:

 $ mysqlcheck -u root -p --auto-repair --optimize --all-databases

See also: