Navigation:  Setting up a Database, Table and Users >

MySQL SQL Shell

Top  Previous  Next

start the SQL shell by typing

 

mysql -u root -p

 

Note that you will need to be in the c:\mysql\bin directory if you have not added the c:\mysql\bin directory to your path. All commands shown in this chapter will need to be typed in the SQL shell.

 

Creating a New Database

Databases are always created with the create database command, so type

 

create database EventSentry;

 

to create the EventSentry database.

 

Setting up the tables, indexes and views for EventSentry

Starting with version 2.50, the web reports of EventSentry require several tables to be setup. Unlike earlier versions where you had to setup the tables manually, EventSentry now ships with a Database Setup Wizard that will create all tables, indexes and users automatically for you.

 

To setup the tables you will first have to create a system DSN and then run the database setup wizard.

 

1. Installing the ODBC drivers

If you haven't already downloaded and installed the ODBC drivers, then you will need to do this now. Please see Download & Installation for more information.

 

2. Creating a system DSN

Navigate to Start -> Programs -> Administrative Tools and select the Data Sources (ODBC). Click on the System DSN tab and then click on Add. On the next screen, select the MySQL ODBC 3.51 Driver from the bottom of the list.

 

odbc_driver_selection

 

After clicking finish you should be presented with the ODBC setup dialog. Make sure that you enter all information correctly in this dialog and then click the Test button:

 

SystemDSN

 

alert or warning 1 24 n g

You will need to replace mysql-srv in the server field with the computer name of the host where you installed MySQL.

 

3. Running the Database Setup Wizard

If you installed EventSentry with database support, then you will find the Database Setup Wizard in Start -> Programs -> EventSentry. Run this wizard and follow the instructions. The wizard will ask you for the system DSN pointing to the database and the initial password for the eventsentry_svc and eventsentry_web user accounts.

 

Once the wizard has completed creating all the tables, indexes and user accounts, you can verify that all tables were created. First, change the current context to the EventSentry database by typing

 

use EventSentry;

 

and then display all tables with this command:

 

show tables;

 

command which should show output similar to this:

 

+---------------------------+

| Tables_in_eventsentry     |

+---------------------------+

| esapphistory              |

| esappname                 |

| esapppublisher            |

| esappstatus               |

| esdiskspace               |

| esenvironment             |

| eseventlogcategory        |

| eseventlogcomments        |

| eseventlogcomputer        |

| eseventlogdata            |

| eseventlogfilename        |

| eseventlogfilepath        |

| eseventlogfilter          |

| eseventloggroup           |

| eseventlogid              |

| eseventloglocation        |

| eseventloglocationmapping |

| eseventloglog             |

| eseventlogmain            |

| eseventlogsource          |

| eseventlogtype            |

| eseventloguser            |

| esgroupmapping            |

| esheartbeathistory        |

| esheartbeatldescription   |

| esheartbeatlstatus        |

| esheartbeatltype          |

| esheartbeatpingtracking   |

| esheartbeatstatus         |

| eslogontracking           |

| esmotiontracking          |

| esnessuskb                |

| esnessuslog               |

| esnessusport              |

| esperformance             |

| esperformancecounter      |

| esperformanceinstance     |

| esperformancename         |

| esprintcost               |

| esprintdocuments          |

| esprintprinters           |

| esprinttracking           |

| espstracking              |

| essearchadvanced          |

| essearchsimple            |

| esservicehistory          |

| esservicekey              |

| esservicename             |

| esservicestatus           |

| esstrings                 |

| essysinfo                 |

+---------------------------+

51 rows in set (0.00 sec)