Search code examples
mysqlsqlhardware-id

Get hardware information from a database server


I want to get hardware information from a database server, which may not be in my private network, like the network card's MAC address, or the CPU ID. It has to work on MS SQL and MySQL.

It is needed for some kind of Licensing Model and needs to work over ANY network connection. Something like a Hardware ID of the database server or some kind of serial of the DB Server software, which identifies this server uniquely.

Thanks

Dirk


Solution

  • mysql> STATUS;
    --------------
    ./client/mysql  Ver 14.12 Distrib 5.0.29, for pc-linux-gnu (i686) using readline 5.0
    
    Connection id:          8
    Current database:
    Current user:           mc@localhost
    SSL:                    Not in use
    Current pager:          /usr/bin/less
    Using outfile:          ''
    Using delimiter:        ;
    Server version:         5.0.27-standard MySQL Community Edition - Standard (GPL)
    Protocol version:       10
    Connection:             Localhost via UNIX socket
    Server characterset:    latin1
    Db     characterset:    latin1
    Client characterset:    latin1
    Conn.  characterset:    latin1
    UNIX socket:            /tmp/mysql.sock
    Uptime:                 1 day 3 hours 58 min 43 sec
    
    Threads: 2  Questions: 17  Slow queries: 0  Opens: 11  Flush tables: 1  Open tables: 6  Queries per second avg: 0.000
    --------------
    
    mysql> SHOW VARIABLES LIKE "%version%";
    +-------------------------+------------------------------------------+
    | Variable_name           | Value                                    |
    +-------------------------+------------------------------------------+
    | protocol_version        | 10                                       |
    | version                 | 5.0.27-standard                          |
    | version_comment         | MySQL Community Edition - Standard (GPL) |
    | version_compile_machine | i686                                     |
    | version_compile_os      | pc-linux-gnu                             |
    +-------------------------+------------------------------------------+
    

    http://dev.mysql.com/doc/refman/5.0/en/installation-version.html