Yes it will create the db.define.

*Ben Duncan*
DBA / Chief Software Architect
Mississippi State Supreme Court
Electronic Filing Division


On Wed, Feb 13, 2019 at 1:55 PM Andrea Fae' <and...@gmail.com> wrote:

> Hello!
> I followed the instruction you wrote me.
> But at that point:" load web2py app, ensure migrate is true, so that will
> create the tables defined in web2py"
>
> I have this error:
>
> Error ticket for "ga"Ticket ID
>
> 127.0.0.1.2019-02-13.20-49-28.fcc1a494-3aa4-42c2-b1a9-ab14a466e72e
> <type 'exceptions.RuntimeError'> Failure to connect, tried 5 times:
> Traceback (most recent call last): File
> "C:\web2py\gluon\packages\dal\pydal\base.py", line 454, in __init__
> self._adapter = adapter(**kwargs) File
> "C:\web2py\gluon\packages\dal\pydal\adapters\__init__.py", line 40, in
> __call__ obj = super(AdapterMeta, cls).__call__(*args, **kwargs) File
> "C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 368, in
> __init__ super(SQLAdapter, self).__init__(*args, **kwargs) File
> "C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 52, in __init__
> self.reconnect() File "C:\web2py\gluon\packages\dal\pydal\connection.py",
> line 172, in reconnect self.connection = self.connector() File
> "C:\web2py\gluon\packages\dal\pydal\adapters\mysql.py", line 52, in
> connector return self.driver.connect(**self.driver_args) File
> "C:\web2py\gluon\contrib\pymysql\__init__.py", line 90, in Connect return
> Connection(*args, **kwargs) File
> "C:\web2py\gluon\contrib\pymysql\connections.py", line 688, in __init__
> self.connect() File "C:\web2py\gluon\contrib\pymysql\connections.py", line
> 905, in connect self._get_server_information() File
> "C:\web2py\gluon\contrib\pymysql\connections.py", line 1231, in
> _get_server_information self.server_charset = charset_by_id(lang).name File
> "C:\web2py\gluon\contrib\pymysql\charset.py", line 38, in by_id return
> self._by_id[id] KeyError: 255Versione
> web2py™ Version 2.16.1-stable+timestamp.2017.11.14.05.54.25Traceback
>
> 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.
> 26.
> 27.
> 28.
> 29.
> 30.
> 31.
> 32.
> 33.
> 34.
> 35.
> 36.
>
> Traceback (most recent call last):
>   File "C:\web2py\gluon\restricted.py", line 219, in restricted
>     exec(ccode, environment)
>   File "C:/web2py/applications/ga/models/db.py" 
> <http://127.0.0.1:8000/admin/default/edit/ga/models/db.py>, line 34, in 
> <module>
>     check_reserved=['all'])
>   File "C:\web2py\gluon\packages\dal\pydal\base.py", line 169, in __call__
>     obj = super(MetaDAL, cls).__call__(*args, **kwargs)
>   File "C:\web2py\gluon\packages\dal\pydal\base.py", line 474, in __init__
>     "Failure to connect, tried %d times:\n%s" % (attempts, tb)
> RuntimeError: Failure to connect, tried 5 times:
> Traceback (most recent call last):
>   File "C:\web2py\gluon\packages\dal\pydal\base.py", line 454, in __init__
>     self._adapter = adapter(**kwargs)
>   File "C:\web2py\gluon\packages\dal\pydal\adapters\__init__.py", line 40, in 
> __call__
>     obj = super(AdapterMeta, cls).__call__(*args, **kwargs)
>   File "C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 368, in 
> __init__
>     super(SQLAdapter, self).__init__(*args, **kwargs)
>   File "C:\web2py\gluon\packages\dal\pydal\adapters\base.py", line 52, in 
> __init__
>     self.reconnect()
>   File "C:\web2py\gluon\packages\dal\pydal\connection.py", line 172, in 
> reconnect
>     self.connection = self.connector()
>   File "C:\web2py\gluon\packages\dal\pydal\adapters\mysql.py", line 52, in 
> connector
>     return self.driver.connect(**self.driver_args)
>   File "C:\web2py\gluon\contrib\pymysql\__init__.py", line 90, in Connect
>     return Connection(*args, **kwargs)
>   File "C:\web2py\gluon\contrib\pymysql\connections.py", line 688, in __init__
>     self.connect()
>   File "C:\web2py\gluon\contrib\pymysql\connections.py", line 905, in connect
>     self._get_server_information()
>   File "C:\web2py\gluon\contrib\pymysql\connections.py", line 1231, in 
> _get_server_information
>     self.server_charset = charset_by_id(lang).name
>   File "C:\web2py\gluon\contrib\pymysql\charset.py", line 38, in by_id
>     return self._by_id[id]
> KeyError: 255
>
> In file: C:\web2py\applications\ga\models\db.py
>
> 1.
>
> <code object <module> at 000000000AC93830, file 
> "C:\web2py\applications\ga\models\db.py", line 8
>
>
>
> This is my appconfig.ini:
>
> ; App configuration
> [app]
> name        = Welcome
> author      = Your Name <y...@example.com>
> description = a cool new app
> keywords    = web2py, python, framework
> generator   = Web2py Web Framework
>
> ; Host configuration
> [host]
> names = localhost:*, 127.0.0.1:*, *:*, *
>
> ; db configuration
> [db]
> uri       = mysql://root:passwordroot@localhost/gadb?set_encoding=utf8mb4
> migrate   = true
> pool_size = 10 ; ignored for sqlite
>
> ; smtp address and credentials
> [smtp]
> server = smtp.gmail.com:587
> sender = y...@gmail.com
> login  = username:password
> tls    = true
> ssl    = true
>
> ; form styling
> [forms]
> formstyle = bootstrap3_inline
> separator =
>
> I just created the db "gadb" in mysql.exe. You can see the db, but I only
> created the db with the command
>
> mysql> create database gadb; Query OK, 1 row affected (0.02 sec) mysql>
> show databases; +--------------------+ | Database | +--------------------+
> | gadb | | information_schema | | mysql | | performance_schema | | sakila |
> | sys | | world | +--------------------+ 7 rows in set (0.00 sec)
>
> Can you help me what is my mistake?
> THANK YOU
>
>
> Il giorno sabato 9 febbraio 2019 02:03:29 UTC+1, 黄祥 ha scritto:
>>
>> - what version of mysql do I have to install to my PC where I have 2.17
>>> version of web2py? Where can I find?
>>>
>>
>> in windows env there are mysql and mariadb
>> *ref:*
>> https://downloads.mariadb.org
>> https://dev.mysql.com/downloads/mysql/
>>
>> - is it necessary to install drivers or it is still included in my web2py
>>> installed by windows installation method?
>>>
>>
>> web2py already ship the mysql driver
>>
>> - what is the procedure to migrate the db of my application?
>>>
>>
>> better to export and import in csv file
>>
>> *step*:
>> - create database mysql
>> - when web2py using sqlite use export_to_csv_file()
>> - change db uri in private/appconfig.ini from sqlite to mysql
>> - load web2py app, ensure migrate is true, so that will create the tables
>> defined in web2py
>> - when web2py using mysql use import_from_csv_file()
>>
>> *ref:*
>>
>> http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Exporting-and-importing-data
>>
>>
>> another way around is web2py have a scripts/cpdb.py
>> *ref:*
>>
>> http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Copy-data-from-one-db-into-another
>>
>> - after migrating, how to install the application using pyrhonanywhere
>>> site? (I'm just using the app made with SQLite)
>>>
>>
>> *local*
>> - export your database using mysqldump
>> - pack your app from web2py admin
>>
>> *pythonanywhere*
>> - login to pythonanywhere, use tab console to import your mysql database
>> - then in web2py admin just Upload and install packed application
>>
>> best regards,
>> stifan
>>
>> --
> 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.
>

-- 
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