if auth tables are yet in the db, no need to create them

auth.define_table(....,migrate=False)

Alternatively, let the app create the .table files

auth.define_table(.....,fake_migrate=True)

hit the appadmin once, then

auth.define_table(...)

On Wednesday, February 20, 2013 8:24:41 AM UTC+1, Hassan Alnatour wrote:
>
> Dear ALL ,
>
> Am trying to connect to a mysql database but am getting this error  , how 
> can i solve this problem : 
>
> connection string : *URI = 'mysql://root:@localhost/hasaad'*
>
> TICKET ID
>
> 127.0.0.1.2013-02-20.10-10-32.b8a942ff-fb3a-4ba0-b118-fd1fdac873bf
> *<class 'gluon.contrib.pymysql.err.InternalError'> (1050, u"Table 
> 'auth_user' already exists")*VERSIONweb2py™(2, 0, 2, 
> datetime.datetime(2012, 8, 30, 4, 8, 18), 'stable')TRACEBACK
>
> 1.
> 2.
> 3.
> 4.
> 5.
> 6.
> 7.
> 8.
> 9.
> 10.
> 11.
> 12.
> 13.
> 14.
> 15.
> 16.
> 17.
> 18.
> 19.
> 20.
> 21.
> 22.
> 23.
> 24.
> 25.
>
> Traceback (most recent call last):
>
>   File "C:\web2py\gluon\restricted.py", line 209, in restricted
>
>     exec ccode in environment
>   File "C:/web2py/applications/7a9ad/models/db.py" 
> <http://127.0.0.1:8000/admin/default/edit/7a9ad/models/db.py>, line 52, in 
> <module>
>
>     auth.define_tables()
>   File "C:\web2py\gluon\tools.py", line 1464, in define_tables
>
>     format='%(first_name)s %(last_name)s (%(id)s)'))
>
>   File "C:\web2py\gluon\dal.py", line 7041, in define_table
>
>     table = self.lazy_define_table(tablename,*fields,**args)
>
>   File "C:\web2py\gluon\dal.py", line 7072, in lazy_define_table
>
>     polymodel=polymodel)
>   File "C:\web2py\gluon\dal.py", line 848, in create_table
>
>     self.create_sequence_and_triggers(query,table)
>
>   File "C:\web2py\gluon\dal.py", line 1584, in create_sequence_and_triggers
>
>     self.execute(query)
>
>   File "C:\web2py\gluon\dal.py", line 1598, in execute
>
>     return self.log_execute(*a, **b)
>
>   File "C:\web2py\gluon\dal.py", line 1592, in log_execute
>
>     ret = self.cursor.execute(*a, **b)
>
>   File "C:\web2py\gluon\contrib\pymysql\cursors.py", line 117, in execute
>
>     self.errorhandler(self, exc, value)
>
>   File "C:\web2py\gluon\contrib\pymysql\connections.py", line 202, in 
> defaulterrorhandler
>
>     raise errorclass, errorvalue
> InternalError: (1050, u"Table 'auth_user' already exists")
>
> IN FILE: C:\WEB2PY\APPLI
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to