Project

General

Profile

Actions

Feature #3028

closed

add ability to specify mysql port

Added by Dmitry Lyumkis about 9 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Start date:
03/24/2015
Due date:
% Done:

0%

Estimated time:
Deliverable:

Description

for using different port numbers for connecting to mysql db:

add the following lines to sinedon.cfg and leginon.cfg:

port: 3316 ### or any other port number

Just assigning this value is still problematic, because at some point down the line, it is interpreted as a string rather than an integer. Thus, in the leginon repository, I had to add two lines to sqldict.py inside /path/to/sinedon/sqldict.py:

if ‘port’ in kwargs:
kwargs[‘port’] = int(kwargs[‘port’])

Now the code reads like this, and this seems to work:

def init(self, **kwargs):
"""
Create a new SQLDict object.
db: an SQL DB-API database connection object.
The optional keyword arguments are:
host = "DB_HOST"
user = "DB_USER"
db = "DB_NAME"
passwd = "DB_PASS"
"""
if 'port' in kwargs:
kwargs['port'] = int(kwargs['port’])
Actions #1

Updated by Dmitry Lyumkis about 9 years ago

  • Status changed from New to In Code Review
  • Assignee changed from Dmitry Lyumkis to Anchi Cheng
Actions #2

Updated by Anchi Cheng over 8 years ago

  • Status changed from In Code Review to Closed
Actions

Also available in: Atom PDF