Before looking into how to import data, let's take a look at the pre-requisites to connect to the MySQL database.
Prerequisites for MySQL
Please ensure the following conditions are met before proceeding with connecting to your MySQL.
1. Provide database read permissions to the Zoho DataPrep server.
2. Ensure you have the correct login credentials for your database. As a best practice, try connecting to your target database from the Zoho DataPrep server, using the native database management software available for the respective database.
Enable remote connections
Login to your MySQL database as a root user. Navigate to the <MySql_Home>\bin folder in terminal/command prompt, and run the following command.
mysql -u root -p
- Enter your MySQL root password.
- Run the following command to enable GRANT access.
mysql> GRANT ALL ON <Database Name>.* TO <Username>@<IP address> IDENTIFIED BY <Password>;
Note:
- <IP address> must be replaced with the IP address of the Zoho DataPrep server.
- <Database Name> must be replaced with the name of the database with which you are trying to establish a connection.
- <Username> must be replaced with the database user name.
- <Password> must be replaced with the corresponding password.
To import data from MySQL
1. Open an existing pipeline or
create a pipeline from the
Home Page,
Pipelines tab or
Workspaces tab and click the
Add data option.
Info: You can also click the Import data
icon at the top of the pipeline builder to bring data from multiple sources into the pipeline.
2. In the next screen, choose the required database or click the Databases category from the left pane.
3. Select New connection from the Connection drop down. If you have existing connections, you can choose the required connection from the Connection drop down.
4. Give your connection a name under the Connection name section.
5. Zoho Databridge is a tool that facilitates importing data from local databases. Databridge is mandatory to import data from any local database.
Note: If this is the first time you are downloading Zoho Databridge, see how to install it
here.
6. Once you have installed Databridge on your machine, select your Databridge from the Databridge drop-down.
Note: Select the Databridge which is installed in the same network as the database you want to import the data from.
7. Select MySQL in the Database type drop down and enter the Database server host name and Port number.
8. Enter your Database name and provide the username and password if authentication is required.
9. Save your database configuration and connect to the database using Connect.
Note: The connection configuration will be automatically saved for importing from the database in the future. Credentials are securely encrypted and stored.
10. Select the tables that need to be imported.
11. You can also use alternatively a SQL query to import data.
The incremental fetch option is not available when the data is imported using a query from databases. Click here to know more about incremental fetch from local database.
12. Click the Import button.
13. Once you have completed importing data, Pipeline builder page will open from where you can start applying transforms.
To edit the MySQL connection
DataPrep saves your data connections to avoid the hassle of keying in the credentials every time you need to connect to a data source or destination. You can always edit the saved data connection and update them with new parameters or credentials using the Edit connection option.
1. While creating a new dataset, click Saved data connections from the left pane in the Choose a data source section.
2. You can manage your saved data connections right from the data import screen. Click the ellipsis (3 dots) icon to share, edit, view the connection overview, or remove the connection.
3. Click the Edit connection option to update the saved connection with new parameters or credentials.