HTM gym - Can't connect to MySQL server on Windows

I’m trying to run the hot gym prediction example on my windows machine. I followed the instructions in Running NuPIC on Windows and set the database password inside C:\Python27\Lib\site-packages\nupic\support\nupic-site.xml

I checked that MySQL is running on the default port 3306.

When running python swarm.py I’m getting the following error:

Traceback (most recent call last):
  File "swarm.py", line 111, in <module>
    swarm(INPUT_FILE)
  File "swarm.py", line 103, in swarm
    modelParams = swarmForBestModelParams(SWARM_DESCRIPTION, name)
  File "swarm.py", line 80, in swarmForBestModelParams
    verbosity=0
  File "C:\Python27\lib\site-packages\nupic\swarming\permutations_runner.py", line 271, in runWithConfig
    return _runAction(runOptions)
  File "C:\Python27\lib\site-packages\nupic\swarming\permutations_runner.py", line 212, in _runAction
    returnValue = _runHyperSearch(runOptions)
  File "C:\Python27\lib\site-packages\nupic\swarming\permutations_runner.py", line 141, in _runHyperSearch
    search = _HyperSearchRunner(runOptions)
  File "C:\Python27\lib\site-packages\nupic\swarming\permutations_runner.py", line 412, in __init__
    self.__cjDAO = _clientJobsDB()
  File "C:\Python27\lib\site-packages\nupic\swarming\permutations_runner.py", line 376, in _clientJobsDB
    return cjdao.ClientJobsDAO.get()
  File "C:\Python27\lib\site-packages\nupic\support\decorators.py", line 56, in exceptionLoggingWrap
    return func(*args, **kwargs)
  File "C:\Python27\lib\site-packages\nupic\database\client_jobs_dao.py", line 548, in get
    cjDAO.connect()
  File "C:\Python27\lib\site-packages\nupic\support\decorators.py", line 56, in exceptionLoggingWrap
    return func(*args, **kwargs)
  File "C:\Python27\lib\site-packages\nupic\support\decorators.py", line 208, in retryWrap
    result = func(*args, **kwargs)
  File "C:\Python27\lib\site-packages\nupic\database\client_jobs_dao.py", line 633, in connect
    with ConnectionFactory.get() as conn:
  File "C:\Python27\lib\site-packages\nupic\database\connection.py", line 167, in get
    return cls._connectionPolicy.acquireConnection()
  File "C:\Python27\lib\site-packages\nupic\database\connection.py", line 553, in acquireConnection
    dbConn = self._pool.connection(shareable=False)
  File "C:\Python27\lib\site-packages\DBUtils\PooledDB.py", line 331, in connection
    con = self.steady_connection()
  File "C:\Python27\lib\site-packages\DBUtils\PooledDB.py", line 279, in steady_connection
    *self._args, **self._kwargs)
  File "C:\Python27\lib\site-packages\DBUtils\SteadyDB.py", line 134, in connect
    failures, ping, closeable, *args, **kwargs)
  File "C:\Python27\lib\site-packages\DBUtils\SteadyDB.py", line 186, in __init__
    self._store(self._create())
  File "C:\Python27\lib\site-packages\DBUtils\SteadyDB.py", line 190, in _create
    con = self._creator(*self._args, **self._kwargs)
  File "C:\Python27\lib\site-packages\pymysql\__init__.py", line 88, in Connect
    return Connection(*args, **kwargs)
  File "C:\Python27\lib\site-packages\pymysql\connections.py", line 626, in __init__
    self._connect()
  File "C:\Python27\lib\site-packages\pymysql\connections.py", line 818, in _connect
    2003, "Can't connect to MySQL server on %r (%s)" % (self.host, e))
pymysql.err.OperationalError: (2003, "Can't connect to MySQL server on 'localhost' (255)")

I tried:

ALTER USER ‘root’@‘localhost’ IDENTIFIED WITH mysql_native_password BY ‘YourRootPassword’;
FLUSH PRIVILEGES;

from: ERROR running swarming tests using mysql user override without setting environment variable NTA_CONF_PATH · Issue #3189 · numenta/nupic-legacy · GitHub
but that didn’t work.

Changing the address from localhost to 127.0.0.1 didn’t help either.

C:\Program Files\MySQL\MySQL Server 8.0\bin>perror 255
Win32 error code 255: The extended attributes are inconsistent.

I’m sorry but I don’t have a Windows machine to replicate this. But do you really need to swarm? It usually is not necessary. I also talked about swarming (and why you might not want to use it) in the last hackers’ hangout.

1 Like

I was just trying to follow the One Hot Gym Prediction tutorial. And the first step for that is running a swarm. I don’t think the rest of the tutorial will work without doing swarming first.

I need to retire that example (finally). But I have nothing to replace it with yet.