Well, checking for these things should be pretty independent to whether you have Piwik installed or not…
Go to the directory where MySQL is installed (depending on your distro, the directory could be something like this):
Then to check if MySQL is running, run this:
./mysqladmin -u root -p status
If it’s running, you should get a message similar to this one:
Uptime: 14 Threads: 1 Questions: 2 Slow queries: 0 Opens: 33 Flush tables: 1 Open tables: 26 Queries per second avg: 0.142
If indeed the server is running, connect to it, and run this:
mysql> select user();
You should get something like this:
+-------------------+ | user() | +-------------------+ | youruser@localhost| +-------------------+ 1 row in set (0.00 sec)
That’s how you can determine your host name (in this case
localhost). If it hasn’t changed, then you’re golden and you should be able to connect.
Now to make sure your Piwik install is using the right host name, open
config/config.ini.php and make sure your
host variable has the same name:
host = "localhost"
If it is other than what the table above shows, then you need to change it to whatever that table shows.
Now if when you run
./mysqladmin -u root -p status and you get a message similar to this one:
connect to server at 'localhost' failed error: 'Can't connect to local MySQL server through socket '/usr/local/tmp/mysql/mysql.sock' (2)' Check that mysqld is running and that the socket: '/usr/local/tmp/mysql/mysql.sock' exists!
Then obviously your sever is not running and you need to start it; once you do it, you should be able to connect.
Hope that helps.