It appears that newer versions of mysql-server don’t permit using root username to connect when executing from non-root (non-sudo) login. So, you have to create a different username in mysql and configure nupic to use that username before running swarms.
I was using Ubuntu Server 16.04 and mysql 5.7.12 with the swarming tests, but I needed to configure mysql-related settings first to get the mysql connectivity (used by swarming) to work. The error I was getting from mysql was:
ERROR 1698 (28000): Access denied for user 'root'@'localhost' mysql
$ mysql --version
mysql Ver 14.14 Distrib 5.7.12, for Linux (x86_64) using EditLine wrapper
This is what I needed to do to work around this error:
Create a new mysql user “vitaly” and grant this user privileges on all databases. I chose to have a blank password.
$ sudo mysql -u root -p mysql> create user 'vitaly'@'localhost' identified by ''; mysql> GRANT ALL PRIVILEGES ON * . * TO 'vitaly'@'localhost'; mysql> FLUSH PRIVILEGES; mysql> exit Bye
Modify mysql username in nupic configuration by setting my user name in the nupic.cluster.database.user property:
$ vim $NUPIC/src/nupic/support/nupic-default.xml <property> <name>nupic.cluster.database.user</name> <value>vitaly</value> <description>Username for the MySQL database server </description> </property>
Tell nupic and tests where to find the
nupic-default.xmlconfiguration file NOTE: I needed this step, because running swarming tests was resulting in the ERROR
OperationalError: (2003, "Can't connect to MySQL server on 'localhost' ((1251, u'Client does not support authentication protocol requested by server; consider upgrading MySQL client'))"). I filed https://github.com/numenta/nupic/issues/3189 for this bug. However,
hotgym.pyexample worked without this step.
$ export NTA_CONF_PATH="$NUPIC/src/nupic/support"
Run the swarming tests
$ ./scripts/run_nupic_tests.py -w
~/nta/nupic/examples/opf/clients/hotgym/simple$ python hotgym.py INFO:__main__:After 100 records, 1-step altMAPE=23.183145 INFO:__main__:After 200 records, 1-step altMAPE=21.548877 INFO:__main__:After 300 records, 1-step altMAPE=21.227594 INFO:__main__:After 400 records, 1-step altMAPE=20.686270 INFO:__main__:After 500 records, 1-step altMAPE=20.417234 INFO:__main__:After 600 records, 1-step altMAPE=20.852339 INFO:__main__:After 700 records, 1-step altMAPE=20.907660 INFO:__main__:After 800 records, 1-step altMAPE=21.137106 INFO:__main__:After 900 records, 1-step altMAPE=20.875763 INFO:__main__:After 1000 records, 1-step altMAPE=20.789707 ~/nta/nupic/examples/opf/clients/hotgym/simple$ echo $? 0