Cannot connect to MYSQL

I recently had a problem where all my addons caused Kodi to crash. Everything else was working correctly. I was still running v15 so I upgraded to v17 (17.1 Git:20170320-nogitfound). This still didnt fix the problem so I did a reinstall of Kodi 17 and renamed the .kodi directory thinking there was something in there causing the addon problems.

This fixed the problem with the addons which are now working again but now Kodi cannot connect to the MySQL server containing my library which is installed on the same box as kodi.

Code:
ERROR: Unable to open database: MyVideos107 [2003](Can't connect to MySQL server on '192.168.0.6' (101))

I have copied the old advancedsettings.xml file from the previous install which is being picked up as seen in the log file:

Code:
13:30:09.911 T:140686524279168  NOTICE: Contents of special://profile/advancedsettings.xml are...
                                            <advancedsettings>
                                              <useddsfanart>true</useddsfanart>
                                              <cputempcommand>cputemp</cputempcommand>
                                              <gputempcommand>gputemp</gputempcommand>
                                              <samba>
                                                <clienttimeout>30</clienttimeout>
                                              </samba>
                                              <network>
                                                <disableipv6>true</disableipv6>
                                              </network>
                                              <videodatabase>
                                                <type>mysql</type>
                                                <host>192.168.0.6</host>
                                                <port>3306</port>
                                                <user>root</user>
                                                <pass>*****</pass>
                                              </videodatabase>
                                            </advancedsettings>

I have tried changing the IP to localhost, 127.0.0.1 and it makes no difference.
I can connect and login to the MySQL server using ssh.

Any suggestions?

Cheers
BM