I deleted the auth tables from the /databases folder in my MYSQL and tried 
to rebuild it but getting this error:
Ticket ID

10.51.133.94.2018-01-23.11-38-10.52ecfb9b-da14-4a88-a568-063c7b741936
<class '_mysql_exceptions.OperationalError'> (1050, "Table 'auth_user' already 
exists")Version
web2py™ Version 2.14.6-stable+timestamp.2016.05.10.00.21.47Traceback

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 "/opt/web2py_apps/web2py/gluon/restricted.py", line 227, in restricted
    exec ccode in environment
  File "/opt/web2py_apps/web2py/applications/cryoem/models/db.py" 
<https://10.10.10.101/admin/default/edit/cryoem/models/db.py>, line 108, in 
<module>
    auth.define_tables(username=False, signature=False)
  File "/opt/web2py_apps/web2py/gluon/tools.py", line 2376, in define_tables
    format='%(first_name)s %(last_name)s (%(id)s)'))
  File "/opt/web2py_apps/web2py/gluon/packages/dal/pydal/base.py", line 834, in 
define_table
    table = self.lazy_define_table(tablename,*fields,**args)
  File "/opt/web2py_apps/web2py/gluon/packages/dal/pydal/base.py", line 873, in 
lazy_define_table
    polymodel=polymodel)
  File "/opt/web2py_apps/web2py/gluon/packages/dal/pydal/adapters/base.py", 
line 482, in create_table
    self.create_sequence_and_triggers(query, table)
  File "/opt/web2py_apps/web2py/gluon/packages/dal/pydal/adapters/base.py", 
line 1369, in create_sequence_and_triggers
    self.execute(query)
  File "/opt/web2py_apps/web2py/gluon/packages/dal/pydal/adapters/base.py", 
line 1388, in execute
    return self.log_execute(*a, **b)
  File "/opt/web2py_apps/web2py/gluon/packages/dal/pydal/adapters/base.py", 
line 1382, in log_execute
    ret = self.get_cursor().execute(command, *a[1:], **b)
  File "/usr/lib64/python2.7/site-packages/MySQLdb/cursors.py", line 205, in 
execute
    self.errorhandler(self, exc, value)
  File "/usr/lib64/python2.7/site-packages/MySQLdb/connections.py", line 36, in 
defaulterrorhandler
    raise errorclass, errorvalue
OperationalError: (1050, "Table 'auth_user' already exists")


On Monday, January 22, 2018 at 6:29:16 PM UTC-6, Jim S wrote:
>
> See Anthony's original answer to this question.  All you should need to do 
> is remove the associated *.table files from the /databases folder.  Also, 
> make sure you have migrations turned on by setting migrate=True in you 
> DAL() setup.
>
> -Jim
>
> On Monday, January 22, 2018 at 6:06:10 PM UTC-6, SR wrote:
>>
>> How do we recreate the auth tables after it has been dropped in mysql 
>> database?
>> I would really appreciate your help. 
>>
>> On Monday, November 25, 2013 at 8:34:18 PM UTC-6, Anthony wrote:
>>>
>>> web2py thinks it already created those tables (you dropped them outside 
>>> of web2py, so it doesn't know they're gone). Try removing the associate 
>>> *.table files in the /databases folder (they store the migration 
>>> information for each table).
>>>
>>> Anthony
>>>
>>> On Monday, November 25, 2013 9:22:58 PM UTC-5, Julien Courteau wrote:
>>>>
>>>> (a) I did: drop table <auth tables>; <auth tables> == ["auth_user", 
>>>> "auth_group", etc...] in a sqlite3 shell;
>>>>
>>>> (b) I refresh my index page: web2py execute the auth.define_table() 
>>>> silently but no tables had been
>>>> created (sql.log contains no create table). I tried to figure out 
>>>> what's happening without success.
>>>> It did the same if I create a fresh new app. I use web2py 2.5.1. Any 
>>>> clues? How Could I do to figure 
>>>> out the problem?
>>>> Thanks.
>>>>
>>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
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/d/optout.

Reply via email to