datajoint / datajoint-matlab

Relational data pipelines for the science lab
MIT License
42 stars 38 forks source link

Cannot connect to local database in 2024a #438

Open noamza opened 4 months ago

noamza commented 4 months ago

Bug Report

I cannot connect to my local mysql database

Description

I couldn't see in the documentation https://datajoint.github.io/datajoint-docs-original/matlab/index.html how I am supposed to connect but running dj.conn() does not seem to work, regardless of setting name, pw, host.

Reproducibility

Include:

Error using mym SSL connection error: unknown error number

Error in [dj.Connection/query](matlab:matlab.lang.internal.introspective.errorDocCallback('dj.Connection/query', 'C:\Users\noama\AppData\Roaming\MathWorks\MATLAB Add-Ons\Toolboxes\DataJoint+dj\Connection.m', 167)) ([line 167](matlab: opentoline('C:\Users\noama\AppData\Roaming\MathWorks\MATLAB Add-Ons\Toolboxes\DataJoint+dj\Connection.m',167,0))) self.connId=mym(-1, 'open', self.host, self.user, self.password, self.use_tls);

Error in [dj.conn](matlab:matlab.lang.internal.introspective.errorDocCallback('dj.conn', 'C:\Users\noama\AppData\Roaming\MathWorks\MATLAB Add-Ons\Toolboxes\DataJoint+dj\conn.m', 107)) ([line 107](matlab: opentoline('C:\Users\noama\AppData\Roaming\MathWorks\MATLAB Add-Ons\Toolboxes\DataJoint+dj\conn.m',107,0))) query(connObj, 'status')

Expected Behavior

see schemas

Screenshots

Additional Research and Context

noamza commented 4 months ago

I solved this by running the following on my mysql connection on localhost:

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'newrootpassword'

and then connecting through dj with TLS set to false.

stephenholtz commented 1 day ago

I just ran into this issue as well, it is because inside of conn.m

elseif ~isstruct(use_tls)
    use_tls = 'none';

And the string 'none' is not handled. If you comment this out and or/change 'none' to 'false', it will work. Maybe one of the maintainers can let us know if that is a problematic fix, happy to make a PR if it seems useful.

dimitri-yatsenko commented 1 day ago

Thank you, @stephenholtz . We will review and merge. As you know, we are focusing on datajoint-python and your contribution to datajoint-matlab is most appreciated.

stephenholtz commented 22 hours ago

Gotcha, I'll try to do it over the weekend