すべてのバージョン
Bamboo 5.13Bamboo 5.7.x
Bamboo 5.6.x
More...
These instructions will help you connect Bamboo to a MySQL 5.x database.
(MySQL 4.1 is not a supported database for use with Bamboo.)
Please note, the JDBC driver for MySQL 5.x (JDBC Connector/J 5.1) is bundled with Bamboo. You do not have to download and install the driver.
To connect Bamboo to an external MySQL database, you must first create and configure it. This database must be configured to use:
utf8
character set encoding, instead of latin1
utf8_bin
collationIf your MySQL database server is configured to use a storage engine other than InnoDB by default (such as MyISAM), then if possible change it to use InnoDB. Otherwise, you can configure Bamboo's JDBC connection to your MySQL database so that any tables which Bamboo creates in this database will be done using the InnoDB database engine.
A MySQL database administrator can easily create and configure a MySQL database for Bamboo by running the following MySQL commands:
mysql> CREATE DATABASE bamboo CHARACTER SET utf8 COLLATE utf8_bin; mysql> GRANT ALL PRIVILEGES ON bamboo.* TO 'bamboouser'@'localhost' IDENTIFIED BY 'password'; mysql> FLUSH PRIVILEGES; mysql> QUIT
This creates an empty MySQL database for Bamboo named bamboo
.
注意:
bamboouser
— the user account name for the Bamboo MySQL databaselocalhost
— the host name of the MySQL database serverpassword
— the password for this user accountlocalhost
and not set a password by omitting IDENTIFIED BY 'password'
from the 2nd MySQL statement above (if you trust the security within this computer).For more information about configuring character set encoding and collation for Bamboo MySQL databases, please refer to the MySQL 5 documentation — Specifying Character Sets and Collations.
Bamboo provides two ways to connect to a MySQL database — via JDBC or via a datasource. JDBC is generally simpler and is the recommended method.
To connect Bamboo to a MySQL database, via JDBC,
com.mysql.jdbc.Driver
(if different from the default).autoReconnect=true
flag.
useUnicode=true
and characterEncoding=utf8
flags.sessionVariables=storage_engine=InnoDB
flag.jdbc:mysql://localhost/bamboo?autoReconnect=true&useUnicode=true&characterEncoding=utf8&sessionVariables=storage_engine=InnoDB
autoReconnect=true
flag is not specified, the MySQL JDBC driver will eventually time out and Bamboo will no longer be able to communicate with the database.bamboouser
defined in section 1 (above).password
defined in section 1 (above). Leave this field blank if a password for the database user account was not specified.Screenshot 1: 'Setup JDBC Connection (MySQL)'
To connect Bamboo to a MySQL database, via a datasource,
autoReconnect=true
, useUnicode=true
and characterEncoding=utf8
flags, such that your database URL should look similar to:jdbc:mysql://localhost/bamboo?autoReconnect=true&useUnicode=true&characterEncoding=utf8
sessionVariables=storage_engine=InnoDB
flag in this URL.Datasource example
You can see an example of Tomcat with a MySQL database as a datasource in the following document: Tomcat and External MySQL Datasource Example.
java:comp/env/jdbc/DataSourceName
does not work, try jdbc/DataSourceName
(and vice versa).Screenshot 2: 'Setup Datasource Connection'