how do i import and export mysql data? - apriori · how do i import and export mysql data ... the...
TRANSCRIPT
aPriori Confidential
www.aPriori .com 1
How do I Import and Export MySQL Data? Doc ID: 1029-2 Applies to aPriori versions: 2011R2, 2012R1
This document is aPriori confidential. Any and all non-disclosure agreements apply.
____________________________________________________________________ Summary
At times you may be asked by aPriori support to export your database for testing or to import a database that we
send you. This document describes he procedure for exporting and importing aPriori data stored in a MySQL
server.
Exporting the MySQL Data
The easiest way to Export the MySQL data is to use the import/export utility created by aPriori support. To do so
please download the following file by copying the URL and pasting it into your browser’s navigation bar.
Script: transfer.apriori.com/download/p/MySQL_Import_export.cmd
Once the download is complete:
• Copy the script into the bin folder of your MySQL installation directory (Usually C:\Program
Files\MySQL\MySQL Server 5.1\bin)
• Run the script as a windows administrator
• Follow the onscreen instructions
• The script will output the data from your apriori schema to the bin folder of your MySQL installation
Manually Exporting the MySQL Data
You can also manually export your MySQL data by following the below instructions:
• Navigate to the bin folder inside of your aPriori installation (Usually C:\Program Files\MySQL\MySQL
Server 5.1\bin) and open a command window
• Enter the following command substituting the appropriate value for the bolded terms
mysqldump --host=hostname --port=portnumber --user=username --password=password
schema_name > outputfile.sql
Sending Data to Support
Once you have successfully exported your data please zip it and upload the compressed file to our transfer site
www.apriori.com/dropbox. Then send an email to [email protected] notifying us of the upload. If your part
aPriori Confidential
www.aPriori .com 2
is too large to fit on the transfer site please use a file splitting utility to break it into chunks that are smaller than
2GB.
Importing the MySQL Data
The easiest way to Import the MySQL data is to use the import/export utility created by aPriori support. To do
so please download the following file by copying the URL and pasting it into your browser’s navigation bar.
Script: transfer.apriori.com/download/p/MySQL_Import_export.cmd
Once the download is complete:
• Copy the script into the bin folder of your MySQL installation directory (Usually C:\Program
Files\MySQL\MySQL Server 5.1\bin)
• Run the script as a windows administrator
• Follow the onscreen instructions
• The script will require you to enter the root password for your MySQL installation. If you do not know the
root password for your MySQL installation you can recover it by following the instructions at the following URL: http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html
• Once the script has finished running confirm that you are able to connect with the proper version of the
aPriori client
Manually Importing the MySQL Data
You can also manually import your MySQL data by following the below instructions:
• Navigate to the bin folder inside of your aPriori installation (Usually C:\Program Files\MySQL\MySQL
Server 5.1\bin) and open a command window
• Enter the following set of commands substituting the appropriate value for the bolded terms
Mysql.exe --host=hostname --port=portnumber --user=root_username --password=root_password –e
“DROP DATABASE schema_name”
Mysql.exe --host=hostname --port=portnumber --user=root_username --password=root_password –e
“CREATE DATABASE schema_name”
Mysql.exe --host=hostname --port=portnumber --user=root_username --password=root_password –e
schema_name < path\to\datafile\datafile_name.sql