...
These instructions are based on Mac OS X
...
, although the steps should be easily transferable to another operating system.
Note |
---|
|
These instructions assume you are using MySQL as your DBMS and have it installed it according to the instructions documented here. If you are using a different DBMS, you will need to adjust the SQL statements in the attached CreateExamplegearDatabase_v1.sql file to conform to the syntax of that DBMS. |
...
Table plus |
---|
border | 0 |
---|
heading | 0 |
---|
multiple | false |
---|
enableHeadingAttributes | false |
---|
columnAttributes | style="border:0;width=5%;",style="border:0;width=65%;",style="border:0;width=30%;max-width=30% !important;" |
---|
id | steps_table |
---|
enableSorting | false |
---|
enableHighlighting | false |
---|
|
Image Added | Create the Examplegear Database Schema- Download the attached CreateExamplegearDatabase_v1.sql file to your local machine.
- Open a Terminal window and do the following:
- Navigate to the directory to which you downloaded the the attached CreateExamplegearDatabase_v1.sql file.
Go into the mysql command line program as the root user by first command shown to the right. - At the mysql prompt, execute the second command shown to the right to create the database and populate it with data.
| Command to go into the mysql command line program: Code Block |
---|
language | text |
---|
theme | DJango |
---|
linenumbers | true |
---|
| mysql -u root mysql |
Command to create the database schema: Code Block |
---|
language | text |
---|
theme | DJango |
---|
linenumbers | true |
---|
| source CreateExamplegearDatabase_v1.sql |
|
| Image Added | Verify the database creation was successful- Execute the commands shown to the right at the mysql prompt to ensure the schema and each of the tables were created successfully.
- The output should look like the screenshot shown to the right.
- At this point you should have the following:
- A MySQL database named examplegeardb running on port 3306 with a URL of localhost.
- A user account dbuser with a password of mypassword.
- These tables:
- Addresses
- Customers
- Departments
- Employees
- LineItems
- Products
- Ref_AddressTypeCode
- Ref_CountryCode
- Ref_EmployeeStatusCode
- Ref_OrderStatusCode
- Sales
| Commands to verify the database creation:
Code Block |
---|
language | text |
---|
theme | DJango |
---|
linenumbers | true |
---|
|
|
|
...
export PATH=$PATH:/usr/local/mysql/bin
...
Go into the mysql command line program as the root user by executing the following command in a Terminal window:
Code Block |
---|
language | text |
---|
theme | DJango |
---|
linenumbers | true |
---|
|
mysql -u root mysql |
use examplegeardb;
show tables; |
Output of the above commands: Image Added |
| Image Added | Create the Data Source ProfileTo 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. - 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. - 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).
- Click the ">" icon to expand that entry.
- Click Configure.
- In the Data Source Profiles section, add a new entry with the information shown to the right.
- The Name parameter (examplegeardb) will be the name you reference when using the SQL Query macro.
- 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.
- Your screen should look like the screenshot shown on the right.
- Click Save to save your changes.
| Anchor |
---|
| CreateDataSourceProfile |
---|
| CreateDataSourceProfile |
---|
| Parameters for the new examplegeardb data source profile: Div |
---|
| Name | examplegeardb | Value | dbUrl=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: Image Added |
|
Database Schema
Include Page |
---|
| _RecipeStyles |
---|
| _RecipeStyles |
---|
|