'Exception' with message 'Can't connect to local MySQL server through socket '/tmp/mysql.sock(2)

问题:Anemometer安装

PHP Fatal error:  Uncaught exception 'Exception' with message 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)' in /var/www/html/anemometer/lib/AnemometerModel.php:282\nStack trace:\n#0 /var/www/html/anemometer/lib/Anemometer.php(65): AnemometerModel->connect_to_datasource()\n#1 /var/www/html/anemometer/index.php(36): Anemometer->__construct(Array)\n#2 {main}\n  thrown in /var/www/html/anemometer/lib/AnemometerModel.php on line 282

解决办法:

vim /var/www/html/anemometer/conf/datasource_localhost.inc.php

'Exception' with message 'Can't connect to local MySQL server through socket '/tmp/mysql.sock(2)