BMC Mainframe documentation is now on docs.bmc.com

We are pleased to announce that technical documentation for BMC Mainframe products is available on docs.bmc.com. Now you can save favorites, watch pages for changes, search, and comment on every page. Check out the announcement.

We've been recognized

Docs.bmc.com has been recognized for providing a great online experience for doc like BMC Cloud Lifecycle Management 4.6. Check out 5 Real-life Examples of Beautiful Technical Documentation.

 
 

Oracle MySQL Server

Discover with BMC Discovery
download

This product can be discovered by any edition of BMC Discovery. Download our free Community Edition to try it out, or see what else it can discover !

What is this?
This is a product information page, containing details of the information that BMC Discovery gathers about a product and how it is obtained.
Product Name
MySQL Server
Publisher Page
Oracle
Category
Relational Database Management Systems
Release
TKU 2016-Nov-1
Change History
Oracle MySQL Server - Change History
Reports & Attributes
Oracle MySQL Server - Reports & Attributes
Publisher Link
Oracle

 

Product Description

 

Extended Discovery pattern which allows to model Database Detail Nodes being managed by the MySQL Server  is available for this product.

 

Oracle MySQL Server software is one of the most widely used relational database management systems that runs as a server providing multi-user access to a number of databases. It is available both in open source form as well as for commercial use, where several paid editions are available, and offer additional functionality.

Known Versions

  • 3.21
  • 3.23
  • 4.0
  • 4.1
  • 5.0
  • 5.1
  • 5.5
  • 5.6

Software Pattern Summary

Product ComponentOS TypeVersioningPattern Depth
DatabaseServerUnixCommand (Active), Package, PathInstance-based
WindowsCommand (Active), Registry, Package, Path

Platforms Supported by the Pattern

The patterns have been created in a manner that allows each of them to support Windows, Linux and Unix platforms from the same module.

Identification

Software Instance Triggers

OS TypeTrigger NodeAttributeConditionArgument
UnixDiscoveredProcesscmdmatchesregex'\bmysqld(?:-max)?$'
Windows

regex'(?i)\bmysqld\S*\.exe$'

Simple Identification Mappings

The following components/processes are identified using simple identity mappings.

NameCommand
MySQL Database Serverregex'\bmysqld$'
regex'\bmysqld-max$'

regex'(?i)\bmysqld\S*\.exe$'

MySQL Database Server Startup scriptregex'safe_mysqld\b'
regex'mysqld_safe\b'

Versioning

Version information for the product is currently collected using one of four possible methods.

The pattern tries to retrieve the version from 'mysqld -V' command. Pattern requires <full_process_cmd_path> be an absolute path.

 The methods are tried in an order of precedence based on likely success and/or accuracy of the information that can be gathered. Once a result is obtained, the methods lower in precedence are not attempted. In order of precedence the methods are:

Active Versioning

We first of all check that the command line contains a full path to the trigger process by applying the command line to one of the following regular expressions (the first for Windows and the second for Unix/Linux):

  • ^(\w:\\.+?)$

  • ^(/.+?)$

 

If the full path to the process can be established, the following command is executed: 

  • %process.cmd% -V

 

If the previous command failed to be executed, the pattern tries the next one with privileged execution:

  • PRIV_RUNCMD "%process.cmd%" -V  

 

The output is then applied against the following regular expression to extract the version:

  • \s\[vV\]er\s*(\d+(?:\.\d+)*)

Registry Versioning

Windows only

The Registry Query functionality allows for a value to be pulled from the registry, given a valid registry path. This value will then be used as the version number for the product.

The pattern queries the Windows Registry to obtain the registry listing (giving version(s) installed) from the following registry path:

If the registry listing returns a single entry, then the pattern will perform a further Windows registry query to obtain the version information. The query performed is:

Note

If more than one entry is returned, registry versioning will not be performed as Atrium Discovery cannot be certain to correctly assigned the version obtained from registry to the actual instance that has been discovered

Package Versioning

Atrium Dsicovery executes a search for the installed packages and tries to match them against the following regular expressions in the order in which they are presented below:

  • (?i)^MySQL$

  • (?i)^MySQL\[-s\]Server']

When it finds a match, it extracts the version for MySQL RDBMS from the package information. If more than one package matches, only the version information from the first is extracted.

Path Versioning

The Path Regex functionality allows a regular expression to be applied against the MySQL Database Server (mysqld) process command line to derive a version number from the command path or arguments.

The regular expression used is as follows:

  • mysql-(?:max-|standard-|)(\d\.[\.d+\]*)

Application Model Produced by Software Pattern

The pattern has the MySQL Database Server (mysqld, mysqld-max or mysqld\S*\.exe) as its trigger process.

If the trigger process is a child process with the same cmd as its parent, the pattern is immediately stopped; its body will be executed later when the parent trigger process is encountered.

Additional Attributes of the Software Instance created

Port information

On all platforms the pattern initially attempts to discover the database listening port information from the trigger process command line arguments by parsing against the following regular expressions in turn:

  • \-\-port=(\d+)

  • \-P\s+(\d+)

On all platforms the pattern then attempts to discover the database listening port information from the configuration (my.cnf or my.ini) file.

The process command's arguments are parsed using one of the following regular expressions to obtain the full path to this file:

UNIX

  • --defaults-file=(\S+)

Windows

  • "--defaults-file=(.+?)"

  • --defaults-file=(\[Oracle MySQL Server^"s\]+)

  • --defaults-file="(\[Oracle MySQL Server^"\]+)"

On WIndows, if the argument, --defaults-file, is not present in the command line's arguments, the process command is parsed using the following regular expression to obtain the directory of my.ini: * (?i)(\w:.+)\\binOnce located and downloaded, the configuration file is parsed using one of the following regular expressions (dependant on whether instance is known or not) to obtain the port information:

  • (?i)\[%instance%\][^\[]*?port\s*=\s*(\d+)

  • \[\w*mysqld\][^\[]*?port\s*=\s*(\d+)

On UNIX platforms, a secondary method to obtain the listening port information may be used if the pattern determines that the Atrium Discovery user is not root (having executed the 'whoami' command to confirm this).
The pattern executes the following command:

Version 4.1.1 or greater

  • <abs. path to the trigger process binary>/mysqld --verbose --help | grep port

Versions older than 4.1.1

  • <abs. path to the trigger process binary>/mysqld --help | grep port

The output is parsed using the following regular expression: \nport\W*(\d+)

Bind Address

On all platforms the pattern attempts to obtain the bind address from the configuration (my.cnf or my.ini) file.

Once the file is obtained (as described above in the port information section), it is parsed using the following regular expression:

  • [^#]bind-address\s*=\s*((?:\d+\.){3}\d+)

On UNIX platforms, a secondary method to obtain the bind address information may be used if the pattern determines that the Atrium Discovery user is not root (having executed the 'whoami' command to confirm this).
The pattern executes the following command:

  • <abs. path to the trigger process binary>/mysqld --verbose --help | grep bind-address

The output is parsed using the following regular expression:

  • bind-address\s*((?:\d+\.){3}\d+)

Note

bind address is given for information only. The pattern is only able to directly query a database if it has the same IP address as the host

Socket Information

The pattern tries to establish what socket the application is connected to by applying the command line arguments against one of the following regular expressions (the first for Unix and the second for Windows): * socket=(\S+) * socket=(.+)\s

Datadir

The pattern tries to establish the data directory by applying the following regular expression(s) against the command line arguments:

UNIX * datadir=(\S+)If datadir cannot be established by the above methods on the UNIX platform, and the pattern was able to access the configuration file (when obtaining port / bind_address information), the configuration file is parsed using the following regular expression: * ^datadir=(\S+)Windows

  • (?i)datadir="([^"]+)"

  • (?i)datadir=(\S+)

If datadir cannot be established by the above methods on the Windows platform, and the pattern was able to access the configuration file (when obtaining port / bind_address information), the configuration file is parsed using the following regular expression: * (?i)^datadir="?(.+?)["\r]The information obtained is assigned to the db_path attribute on the SI created

SI Depth

The pattern normally generates an instance-based Software Instance. If the data directory path is known, then the SI key is generated based on the hashed value of this path, combined with the SI type and the host key. If the data directory is not known but the port is known, then the key for the generated Software Instance is based on the port, the SI type and host key. If instance is known but not port and data directory, then the key for the generated Software Instance is based on instance, the SI type and host key. If none of these values have been discovered, then a grouped SI is created with the key_group being based on process cmd and full version.

Relationship Creation

If an instance based SI is created, then a number of relationships are also created on the UNIX/Linux platforms.

The pattern performs a search for all the trigger process' child processes running on the host, and then associates them, as child processes, with the Software Instance.

The pattern also performs a search for all the trigger process' parent processes running on the host. The arguments of any parent process matching the following regular expression are then associated, as parent processes, with the Software Instance:

  • (mysqld_safe|safe_mysqld)

Instance

The instance name is extracted from the very end of the trigger process command line arguments using the following regular expressions:

  • ("[^"]+")\s+(\w+)$-> \1###\2

  • ([\-\w]+)\s+(\w+)$-> \1###\2

followed by a third:

  • ###(\w+)$

Bind Address

An attempt is made to extract an ipv4 or ipv6 bind address from the trigger process command line argument by parsing against the following regular expression:

  • \-\-bind-address=((?:\d+\.){3}\d+|[\w\:]+)

or from the config file using one of the following regular expressions dependant upon whether instance is known or not:

  • (?i)\[<instance>\][^\[]*?bind-address\s*=\s*((?:\d+\.){3}\d+|[\w\:]+)

  • \[\w*mysqld\][^\[]*?bind-address\s*=\s*((?:\d+\.){3}\d+|[\w\:]+)

Edition

The edition of the product is derived from either an active command or from its package name.

The output from executing the "<trigger_process_cmd> -V" command is parsed against the following regular expression:

  • (?i)MySQL\s(Advanced|Enterprise|Standard|Community|Extended)\s(?:Server|Edition)

or failing this, from the name of the package by parsing it against the following regular expression:

  • (?i)^MySQL[\-\s]Server[\-\s](advanced|enterprise|standard|community|extended)

A mapping table is then utilised to change them into a consistent format.

Obtaining detailed MySQL Database and table information - Extended database discovery

A separate pattern has been created to query the MySQL Database Server in order to obtain database list and (optionally) database table details. For more information about this pattern, please refer to the relevant page

Subject Matter Expertise

We welcome any subject matter expert information which will help us improve our discovery of MySQL Server.

Testing

Testing has been performed against both a live installation on Linux and Windows and customer record data

Information Sources

Open Issues


Created by: Rebecca Shalfield 26 Nov 2007
Updated by: Dmytro Ostapchuk 21 Nov 2013
Reviewed by: Dmytro Ostapchuk 22 May 2013

© Copyright 2003-2016 BMC Software, Inc, Legal notices
Click here for the provisions described in the BMC License Agreement and Order related to third party products or technologies included in the BMC Product.