Allow a MySQL Client to Connect to Remote MySQL server

By default, MySQL does not allow remote clients to connect to the MySQL database.

If you try to connect to a remote MySQL database from your client system, you will be shown message

ERROR 1130: Host is not allowed to connect to this MySQL server

To allow a specific client ip-address to access the mysql database running on a server,   execute the following command on the server that is running the mysql database.

$ mysql -u root -p
Enter password: 
mysql> use mysql 
mysql> GRANT ALL ON *.* to root@'192.168.1.10' IDENTIFIED BY 'your-root-password';

where 192.168.1.10 is the address of the client machine

Zabbix audit session logins

Recently needed to query the zabbix database running under mysql to obtain the last session logins per user. Zabbix stores all times since epoch  (Jan 1, 1970 00:00 GMT), so it will be necessary to convert these.    This page has useful formatting when using FROM_UNIXTIME example

select users.alias,users.name, FROM_UNIXTIME(lastaccess ,"%Y-%m-%d %T") AS `lastaccess` from sessions,users where users.userid=sessions.userid and lastaccess > (UNIX_TIMESTAMP(NOW()) -282800) order by lastaccess desc

output: zabbix_sessionaudit