Re: [chicagoboss] Re: iam trying to connect my project into mysql database.

77 views
Skip to first unread message

chan sisowath

unread,
Oct 31, 2012, 9:24:50 PM10/31/12
to chica...@googlegroups.com
if i m not wrong, few experience with mysql in erlang
it's a mysql error, from the mysql driver,  {{badmatch,{error,failed_changing_database}},
it s occur when the boss_db up and try to lunch mysql connection to your db
it's mean you have something wrong in your setting or connection to your db.
check again, change different value 


2012/11/1 leetorres <leet...@hotmail.se>
What did you put in your /src/model/test.erl file?


On Tuesday, October 30, 2012 8:17:21 AM UTC+1, cherry wrote:
when iam trying to connect my project with mysql database , my code is following like


boss.config:code


[{boss, [
    {applications, [cbtestproject1]},
    {db_host, "localhost"},
    {db_port, 3306},
    {db_adapter, mysql},
    {db_username, "root"},
    {db_password, "root"},
    {db_database, "cbtestproject1"},
    {log_dir, "log"},
    {server, misultin},
    {port, 8001},
    {session_adapter, mock},
    {session_key, "_boss_session"},
    {session_exp_time, 525600},
    {path, "../ChicagoBoss"},
    {vm_cookie, "my_secret_cookie"}, % Optional, defaults to abc123
    {websocket, true}
]},
{ cbtestproject1, [
    {base_url, "/"},
    {path, "../cbtestproject1"}
]}
].


and i have create tables for my project , code is looking like this


CREATE DATABASE cbtestproject1;

USE cbtestproject1;


CREATE TABLE IF NOT EXISTS `tests` (
`id` bigint(11) unsigned NOT NULL AUTO_INCREMENT,
`username` varchar(32) NOT NULL,
`details` varchar(1024) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;



when i run my project in production mode it is giving errors like this

=ERROR REPORT==== 30-Oct-2012::12:01:42 ===
** Generic server <0.70.0> terminating
** Last message in was {'EXIT',<0.69.0>,
{{badmatch,
{error,
{{badmatch,{error,failed_changing_database}},
[{boss_db_controller,init,1,
[{file,"src/boss_db_controller.erl"},{line,31}]},
{gen_server,init_it,6,
[{file,"gen_server.erl"},{line,304}]},
{proc_lib,init_p_do_apply,3,
[{file,"proc_lib.erl"},{line,227}]}]}}},
[{poolboy,new_worker,2,
[{file,"src/poolboy.erl"},{line,348}]},
{poolboy,prepopulate,4,
[{file,"src/poolboy.erl"},{line,370}]},
{poolboy,init,2,
[{file,"src/poolboy.erl"},{line,74}]},
{gen_fsm,init_it,6,
[{file,"gen_fsm.erl"},{line,361}]},
{proc_lib,init_p_do_apply,3,
[{file,"proc_lib.erl"},{line,227}]}]}}
** When Server state == {state,
{<0.70.0>,poolboy_sup},
simple_one_for_one,
[{child,undefined,boss_db_controller,
{boss_db_controller,start_link,
[[{size,5},
{max_overflow,10},
{adapter,mysql},
{cache_enable,false},
{shards,[]},
{is_master_node,true},
{db_database,"cbtestproject1"},
{db_password,"root"},
{db_username,"root"},
{db_host,"localhost"}]]},
temporary,brutal_kill,worker,
[boss_db_controller]}],
{set,0,16,16,8,80,48,
{[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],
[]},
{{[],[],[],[],[],[],[],[],[],[],[],[],[],[],
[],[]}}},
0,1,[],poolboy_sup,
{boss_db_controller,
[{size,5},
{max_overflow,10},
{adapter,mysql},
{cache_enable,false},
{shards,[]},
{is_master_node,true},
{db_database,"cbtestproject1"},
{db_password,"root"},
{db_username,"root"},
{db_host,"localhost"}]}}
** Reason for termination ==
** {{badmatch,
{error,
{{badmatch,{error,failed_changing_database}},
[{boss_db_controller,init,1,
[{file,"src/boss_db_controller.erl"},{line,31}]},
{gen_server,init_it,6,[{file,"gen_server.erl"},{line,304}]},
{proc_lib,init_p_do_apply,3,
[{file,"proc_lib.erl"},{line,227}]}]}}},
[{poolboy,new_worker,2,[{file,"src/poolboy.erl"},{line,348}]},
{poolboy,prepopulate,4,[{file,"src/poolboy.erl"},{line,370}]},
{poolboy,init,2,[{file,"src/poolboy.erl"},{line,74}]},
{gen_fsm,init_it,6,[{file,"gen_fsm.erl"},{line,361}]},
{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,227}]}]}

why any mistake i did please help me.

--
 
 

Reply all
Reply to author
Forward
0 new messages