Actions
Feature #3028
closedadd ability to specify mysql port
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’])
Updated by Dmitry Lyumkis over 9 years ago
- Status changed from New to In Code Review
- Assignee changed from Dmitry Lyumkis to Anchi Cheng
Updated by Anchi Cheng about 9 years ago
- Status changed from In Code Review to Closed
Actions