Open a-darcher opened 3 years ago
Hi @a-darcher @dimitri-yatsenko I'm interested to contribute. I'm the first time contributor and have idea about docker, MYSQL and django.
Thank you
@a-darcher Thank you for the report but I'm afraid there may be bit of confusion here. :sweat_smile:
In DataJoint Python, you must connect to a MySQL-compatible database server to store your pipeline data. dj.config
provides a way for you to manage in memory several important configuration. That configuration can be dumped or saved to a file using the options: dj.config.save()
, dj.config.save_local()
, dj.config.save_global()
. You can find more information on this here.
One of the configurations that is important to manage is the credentials for you to connect with the database server. dj.set_password()
, however, is a utility that allows you to change your password on the database server. It also provides an option to automatically save out the config to a file to ensure it is in sync but bear in mind that each time you call dj.set_password()
, you are changing your database password.
Regarding access, it is important to add the user+grants properly into the database server before trying to connect. Normally this is done by issuing 2 queries. This is normally done in SQL initially only until you can connect with DataJoint Python.
CREATE USER 'john'@'%%' IDENTIFIED BY 'secret';
-> Allow john
user to connect from any IP address using secret
as a password.GRANT ALL PRIVILEGES ON *.* TO 'john'@'%%';
-> Allow john
user to have full privileges to any schema and any table in the database server. This is usually much higher privilege than is necessary. We'd recommend fine tuning this down in proper production applications once you have finishing prototyping.Let us know if you have any trouble after reviewing the above. We'll plan to mark this as resolved if we don't hear back from you after a week but we can always reopen if needed.
Thanks for your interest @MadhuMPandurangi! We always appreciate any help you can provide. :smiley:
We welcome all PR's but I might suggest having a look at these good-first-issues. We've recently updated them and they should reflect some easy ones to get started.
Please let me know if any of those catch your eye and I can assign them to you.
Bug Report
Description
I am running DataJoint locally via Docker for one project, and would like to connect to a remote DataJoint database for another project. While trying to set-up my remote schema, I saved the dj.config details for the remote database within the directory (
dj.set_password
) and globally on my local machine (dj.config.save_global
). This prevented me from successfully logging into either my locally running database and the remote. I manually removed the files generated bydj.set_password
anddj.config.save_global
,dj_local_conf.json
and~/.datajoint_config.json
respectively, which restored normal access/behavior for my local database. The issue is that I cannot access the remote database, as it seems like my local IP is always used instead of the remote IP.Reproducibility
Specs:
Issue:
dj_local_conf.json
and~/.datajoint_config.json
, and local access was restored.and
but it fails, as it defaults to using my local IP address and won't use the host address for the connection.
Error stack:
Expected Behavior
To be able to access a remote datajoint database from my machine via Jupyter Notebook/Lab, while I have a local datajoint database running from a docker-compose image.
Thanks so much for any help!