admin icon indicating copy to clipboard operation
admin copied to clipboard

<orm.RegisterModel> table name `` repeat register, must be unique

Open milliyang opened this issue 10 years ago • 5 comments

i did all the command in ReadMe.

1, bee new hello 2, cd hello 3, update conf 4, cp -R ../github.com/beego/admin/static ./ 5, p -R ../github.com/beego/admin/views ./ 6, go build 7, ./hello

it turn out error: <orm.RegisterModel> table name `` repeat register, must be unique

milliyang avatar Feb 23 '14 09:02 milliyang

you must create database . https://github.com/astaxie/beego/blob/master/orm/models_boot.go row 34~37. good luck!

ywqwancbx avatar Mar 13 '14 08:03 ywqwancbx

sorry ! I forgot to tell u .first copy admin->app.conf to hello->app.conf

important: rbac_role_table = role rbac_node_table = node rbac_group_table = group rbac_user_table = user
create tables configuration...

ywqwancbx avatar Mar 13 '14 08:03 ywqwancbx

I have create the database,and edit the conf as you had written upstairs. And I change the function "Connection" to this: func Connection() { orm.RegisterDataBase("default", "mysql", "root:bzywet#@tcp(127.0.0.1:3306)/testdb?charset=utf8") }

it turn out error: <orm.RegisterModel> table name `` repeat register, must be unique

@ywqwancbx what's the mean about "You must create database?"

Dannyoung avatar Mar 23 '17 08:03 Dannyoung

please check database config in app.conf ,make sure the db is that you has created. and make sure your conf/app.conf in your execute file directory.

hehexiaoxia avatar Jul 24 '17 09:07 hehexiaoxia

edit the app.confg. db_host = localhost -> db_host = 127.0.0.1

drone789 avatar Oct 16 '17 02:10 drone789