I need a database, but only in local directory of my program. Can pymysql or something like that connect with a db file, not a server?
I only found how to create db with my localhost, but I don't understand where is location of this databases and all my connections options will be in the file, which can be read by everyone.
Related
I haven't been able to find any documentation regarding whether it's possible to access SQLITE3 (using Python) when the SQLITE database is hosted externally:
I have my SQLITE3 database hosted on my VPS (alongside some other stuff that doesn't really matter) - rather than having it as a local file with my Python program.
Therefore, is it possible for me to connect to the SQLITE database which is hosted on my VPS, or will the SQLITE DB have to be hosted locally for me to be able to do this?
The reason I want it to be accessible from my VPS is because I want to be able to run the program on multiple computers and them all have the same access to the database- if this isn't possible, are there any other options which would allow me to do this?
If you want to have a database server with external, possibly remote, applications interacting a client-server protocol switch to PostgreSQL, MariaDB, etc.
see: How to connect to SQLite3 database server?
I have been using heroku to host my bot and it would normally store data in .json files, however it does not write and store to them as github also isn't a database site, is it possible to host my discord bot from heroku and it still edits my database within Mongodb and retrieves so no data is lost?
Yes. Since you can send external requests to outside connections from Heroku, you can easily communicate with MongoDB Atlas using Heroku to host your app.
Reference: How to use Atlas on Heroku
I have an application deployed in pythonanywhere everything is running fine till now. Now I want to connect my app with the database as my application needs to interact with it. My .sql file is stored in my computer.
How can I import it to the project's database in the pythonanywhere server ?
I have tried connecting that database using MySQL Workbench so that I can import from there but Workbench wasn't able to connect to that server.
There are two helpful instructions on PythonAnywhere, one about Backing up (and restoring) MySQL databases other about accessing your MySQL database from outside PythonAnywhere (you can do it using ssh tunnel).
We have a Web Server in our company and create a MySQL Server on OpenShift.
We need to use Python to access the database server without rhc port forward,
Can we have others way to access MySQL on OpenShift directly?
thanks
You can access the gear directly just as you would any other Database not housed on OpenShift.
When you created the MySQL cartridge you should have been given a connection string:
mysql://OPENSHIFT_DB_GEAR_DNS:OPENSHIFT_DB_PORT/...
You can use that provided connection string and authentication to access the application.
Note: These strings above are environment variables on the gear, and will typicaly translate to something like:
mysql://app-namespace.rhcloud.com:55582/
This can be used from outside of the gear by other applications to access the database that is hosted on OpenShift.
Note: The OpenShift forums have lots covering this topic.
Can I somehow work with remote databases (if they can do it) with the Django ORM?
It is understood that the sitting has spelled out the local database. And periodically to make connection to various external databases and perform any sort of commands such as load dump.
If you can connect to the database remotely, then you can simply specify its host/port in settings.py exactly as you would a local one.