Menu

Database Configuration

Jesse Erdmann

All of the connection settings for the database TAPDANCE is to use are copied from tapdance_base_config.pl to the project environment. This includes establishing the connection in Perl that TAPDANCE will use. See the embedded code sample for a configuration example:

# The username to authenticate to the database with
$db_username = "my_db_user";
# The user's password
$db_password = "my_db_password";
# The host where MySQL is running
$db_host = "127.0.0.1";
# The port MySQL is listening on
$db_port = '3306';
# The database to use, the user must have table creation privileges
$db_name = "my_database_name";
# Currently only MySQL is available, but in the future other options may also exist
$db_type = 'mysql';
#Putting it all together
$data_source =
"dbi:$db_type:dbname=$db_name:$db_host;mysql_local_infile=1:$db_port";
# Establishing the connection
$dbh = DBI->connect($data_source, $db_username, $db_password,
{ RaiseError => 1, AutoCommit => 0 });


Related

Wiki: Home

MongoDB Logo MongoDB