problem with mnesia database

1 view
Skip to first unread message

Fernando chucre

unread,
Dec 3, 2008, 10:01:36 AM12/3/08
to erl...@googlegroups.com
Hi all,

i tried use the erlyweb and erlydb with mnesia. Fist my compilation fail, so I apply a patch, then I can't insert more the 1 record!! I think the problem is a identity problem.

I read about create a counter table, but I can't found the contect of this table.

Thanks

--
Fernando Chucre
http://www.horizontesdigitais.com

Michael Mullis

unread,
Dec 4, 2008, 1:20:04 PM12/4/08
to erlyweb
I had some trouble getting mnesia setup under yaws (I'm still
learning :)
This approach seems to work ok.
First we setup mnesia in a normal erlang shell, then we can run yaws
using the ready-to-go mnesia directory. I think the create_table below
is documented in erlydb_mnesia.erl.

mkdir db %% the directory where mnesia files will go
erl -mnesia dir "'db'" %% thats double around single quoted
directory name
1>mnesia:create_schema([node()]).
2>mnesia:info(). %% make sure it says the db director is used
3>mnesia:start().
4>mnesia:create_table(counter, [{disc_copies, [node()]}, {attributes,
[key, counter]}]).
5>q().

That should be good if I recall correctly.
Now start yaws up -- you'll need a working conf file.
For example.
yaws -i --mnesiadir db --pa ../ebin --pa ${ERLYWEB_HOME}/ebin --conf
yaws.conf

Hope that helps,
michael.
Reply all
Reply to author
Forward
0 new messages