Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Table plus
border0
heading0
multiplefalse
enableHeadingAttributesfalse
columnAttributesstyle="border:0;width=5%;",style="border:0;width=65%;",style="border:0;width=30%;max-width=30% !important;"
idsteps_table
enableSortingfalse
enableHighlightingfalse

Examplegear Database v1.0Image Added

Create the Examplegear Database Schema

  1. Download the attached CreateExamplegearDatabase_v1.sql file to your local machine.
  2. Open a Terminal window and do the following:
    1. Navigate to the directory to which you downloaded the the attached CreateExamplegearDatabase_v1.sql file.
    2. Go into the mysql command line program as the root user by first command shown to the right.

    3. At the mysql prompt, execute the second command shown to the right to create the database and populate it with data.

Anchor
step1
step1
Command to go into the mysql command line program:

Code Block
languagetext
themeDJango
linenumberstrue
mysql -u root mysql

 

Command to create the database schema:

Code Block
languagetext
themeDJango
linenumberstrue
source CreateExamplegearDatabase_v1.sql

Examplegear Database v1.0Image Added

Verify the database creation was successful

  1. Execute the commands shown to the right at the mysql prompt to ensure the schema and each of the tables were created successfully.
  2. The output should look like the screenshot shown to the right.
  3. At this point you should have the following:
    1. A MySQL database named examplegeardb running on port 3306 with a URL of localhost.
    2. A user account dbuser with a password of mypassword.
    3. These tables:
      • Addresses
      • Customers
      • Departments
      • Employees
      • LineItems
      • Products
      • Ref_AddressTypeCode
      • Ref_CountryCode
      • Ref_EmployeeStatusCode
      • Ref_OrderStatusCode
      • Sales

Anchor
step2
step2
Commands to verify the database creation:

Code Block
languagetext
themeDJango
linenumberstrue
use examplegeardb;
show tables;

 

Output of the above commands:


Examplegear Database v1.0Image Added

Create the Data Source Profile

To support running SQL queries against the examplegeardb database using the SQL for Confluence (Express Edition) add-on or SQL for Confluence (Pro Edition) add-on, you must build a data source profile.

  1. While logged on to Confluence as a Confluence Administrator, type Manage add-ons in the Search box to go to the Manage Add-ons administration screen.
  2. Scroll through the list of user-installed add-ons until you see the add-on named Bob Swift Atlassian Add-ons - SQL (Pro Edition) or Bob Swift Atlassian Add-ons - SQL (Express Edition).
  3. Click the ">" icon to expand that entry.
  4. Click Configure.
  5. In the Data Source Profiles section, add a new entry with the information shown to the right.
    1. The Name parameter (examplegeardb) will be the name you reference when using the SQL Query macro.
    2. The Value parameter provides the information necessary to connect to the MySQL database you just created, using the user account that was created during the database creation process.
    3. Your screen should look like the screenshot shown on the right.
  6. Click Save to save your changes.

Anchor
step3
step3
Anchor
CreateDataSourceProfile
CreateDataSourceProfile
Parameters for the new examplegeardb data source profile:

Div
stylemax-width: 600px;
Nameexamplegeardb
ValuedbUrl=jdbc:mysql://localhost:3306/examplegeardb?useUnicode=true&characterEncoding=utf8&allowMultiQueries=true|dbUser=dbuser|dbPassword=mypassword|dbDriver=com.mysql.jdbc.Driver|dbJar=http://central.maven.org/maven2/mysql/mysql-connector-java/5.1.34/mysql-connector-java-5.1.34.jar

 

Configure SQL for Confluence screen:

Database Schema

Gliffy
nameExamplegearDB_1.0

...