on 2024 May 20 5:08 AM
In this work, I want to connect my Python 3.9.0 to SQL Anywhere 11. I use a module that I got from this github repository. I want to ask about a line of code in this github repository that I found.
conn = sqlanydb.connect(uid='dba', pwd='sql', eng='demo', dbn='demo' )
What is the meaning of the eng parameter and dbn parameter statements? How do I find the identity of the parameter in my SQL Anywhere? Thank you
Note that SQL Anywhere 11 reached EOMM 31.05.2014.
Here is the basics of connections
dbeng11 -n <eng_name> Database1.db -n <database_name> Database2.db -n <database_name>
The first -n in a database server startup command is the engine (or server name) and the subsequent -n(s) following a database file is the database name. Note: You can run multiple databases on the same engine.
conn = sqlanydb.connect(uid='dba', pwd='sql', eng='<engine_name>', dbn='<database_name>' )
In the absence of -n, the server will be named the same as the first database started. The database name would be the database file name without path and extension.
dbeng11 Database1.db
The engine is Database1 and the database name is Database1. If the database is named as in:
dbeng11 Database1.db -n MyFirstDatabase
the engine name would be the same as the database name or MyFirstDatabase.
Please refer to the SQL Anywhere Server Database Administration book and specifically the Starting and Connecting to your Database for additional information.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I do not have ready access to a SQLA 11 DSN. If you are supplying the database file in the DSN, it is being configured to autostart. It is still best practice to provide an engine name and database name. If all that you have is the credentials and database file, the engine name would be the database name and the database name would be the db file name without the .db extension. lets assume that the database file is MyDatabase.db so the database name would be MyDatabase and the engine name would be MyDatabase. All of this is covered in detail in the documentation that I suggested. Here is a link to SyBooks whihc has SQL Anywhere 11 documentation: https://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.help.sqlanywhere.11.0.1/dbadmin_en11/...
FWIF, the SQL Anywhere 11 help is also available on the SAP Help Portal as a bunch of PDF files:
https://help.sap.com/docs/SAP_SQL_Anywhere?version=11.00.0&locale=en-US
User | Count |
---|---|
71 | |
11 | |
10 | |
10 | |
10 | |
8 | |
7 | |
7 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.