MySQL database: failed to connect to database


#1

Hi Guys-

I’m trying to make the transition to storing data on a mysql database to facilitate use of CPA. I’ve written data to a database and had CP generate my properties file. I filled in the details about how to access the database and I’m getting the following error:

7/27/16 9:53:39.986 AM CellProfiler Analyst[43093]: File “/Applications/CellProfiler Analyst.app/Contents/Resources/CellProfiler-Analyst.py”, line 557, in
7/27/16 9:53:39.986 AM CellProfiler Analyst[43093]: app.Start()
7/27/16 9:53:39.986 AM CellProfiler Analyst[43093]: File “/Applications/CellProfiler Analyst.app/Contents/Resources/CellProfiler-Analyst.py”, line 468, in Start
7/27/16 9:53:39.987 AM CellProfiler Analyst[43093]: db.connect()
7/27/16 9:53:39.987 AM CellProfiler Analyst[43093]: File “/Applications/CellProfiler Analyst.app/Contents/Resources/lib/python2.7/cpa/dbconnect.py”, line 337, in connect
7/27/16 9:53:39.987 AM CellProfiler Analyst[43093]: raise DBException, ‘Failed to connect to database: %s as %s@%s (connID = “%s”).\n %s’%(p.db_name, p.db_user, p.db_host, connID, e)
7/27/16 9:53:39.987 AM CellProfiler Analyst[43093]: cpa.dbconnect.DBException: ERROR: Failed to connect to database: DefaultDB as brian@XXXXX (connID = “MainThread”).
7/27/16 9:53:39.987 AM CellProfiler Analyst[43093]: (2027, ‘Malformed packet’)

Anyone have any tips for troubleshooting this? I tested my access the location of the mysql server. Is the “malformed packet” error significant?


#2
  1. If you re-open your pipeline and go to ExportToDatabase, when you hit “Test Connection” can you connect properly?

  2. What version of CPAnalyst are you running?


#3

Also, did you really mean to connect on port 3036 and not 3306?


#4

Hi!

  1. Yes
  2. version 2.2.1
  3. No, but I get the same error when I correct that typo (?!)

#5

From my googling it seems like it’s probably an error on the database side, not necessarily in CP or CPA (can you get into your DB with a database reader, and does everything look fine?)- you can always file an issue here if you think there’s truly a bug.


#6

Ok, interesting. If you found some useful links can you share them?


Using CPA to take CSV files to SQLite database
#7

I don’t have them open anymore, but searching the GitHubs for CP and CPA for “malformed packet” returned nothing, and searching the forum for that returns only your post, while searching it generally returned different bugs in various MySQL access clients and versions. I’d search that error with your MySQL version number and see what comes up.


#8

Are there any MySQL version requirements for CP/CPA?


#9

Not to my knowledge.


#10

Ok, we’ll try and dig around and see if we can diagnose this. I’ll report back with what we learn.

Thanks,
-Brian