Appendix E: MySQL databases
 
Appendix E: MySQL databases
Setting up FortiAnalyzer with an external MySQL database
Follow the steps listed below to setup your FortiAnalyzer with an external MySQL database.
Set up your MySQL server:
1. Validate that you have a supported version of MySQL. This information will be displayed when you first log into the MySQL monitor. FortiAnalyzer v5.0 Patch Release 6 supports MySQL Server v5.5.
2. Set your server to bind to an accessible address and restart the server. This can be the IP address of any interface on the database host. Fortinet recommends using a private network or a direct cross-connection. Locate the my.cnf file associated with your MySQL installation and change the bind-address to the appropriate IP address.
3. Restart the server.
4. Create a user for your FortiAnalyzer device to use. You will need to create a user with privileges to create a database schema, create tables, update, insert, and select. You can edit these privileges after you have picked a schema name.
 
The minimum privileges for your external FortiAnalyzer user should include SELECT, INSERT, UPDATE, DELETE, EXECUTE, CREATE, ALTER, INDEX, and DROP.
Set up your FortiAnalyzer device:
1. In the FortiAnalyzer CLI console, enter the SQL configuration area:
config system sql
2. Set the SQL status as remote:
set status remote
3. Set the user name and password of the external user you have configured on your MySQL Server:
set username <username_string>
set password <password_string>
4. Set the database name:
set database-name <database_name_string>
Note that whatever name you enter here will create two schemas on your database server, one called ***.db and the other called ***_hcache.db.
5. Tell the FortiAnalyzer how to connect to the server with the following commands:
set database-type mysql
set server <server_IP_address>
6. Exit the config system sql menu using the end command:
end
7. You can validate the connection to your remote database one of two ways: connect to the database server and check for your new schemas, or turn on SQL plugin debugging on your FortiAnalyzer unit and enter the following CLI command:
diagnose debug application sqlplugind 8
This command will allow you to see if a connection has occurred.