Project

General

Profile

Actions

Feature #3028

closed

add ability to specify mysql port

Added by Dmitry Lyumkis over 9 years ago. Updated about 9 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

Also available in: Atom PDF