Connect data source
Connecting to data sources means to establish a connection between Sugar and your relational database (including MySQL、Oracle、SQL Server, etc.) so that Sugar can query the data in your database. This chapter takes MySQL database as an example. It is assumed that you already have a MySQL database, and the data to be analyzed and displayed already exists in the database.
In the SaaS version of the Sugar, sample data source is available to you. If you just want to test the function of Sugar, you can simply use the sample data. You can see it in the data source on the left side of the space.
Configure IP whitelist for MySQL database
Copy IP address
After entering the space (you must be the administrator of the space to do the following operations), click data source > add the data source in the left navigation to see the IP list of Sugar.
Set the IP white list of RDS database
Take Baidu AI Cloud RDS as an example. Other cloud platforms are similar. If you build your own MySQL database, please see [data source management](SUGAR/Operation Guide/Connect to Datasources/Database.md)
- Log in to Baidu AI Cloud and enter the RDS console
- Select a RDS instance and click the instance name
- Set IP white list under the "security" tab
Open public access to MySQL database
Next, the RDS instance needs to open public network access so that Sugar can access your database RDS (if your database cannot be accessed through the public network, such as the intranet or personal LAN. you can use Sugar's intranet tunnel or private deployment). Open RDS public network access on Baidu AI Cloud as follows:
Create a data source and test connectivity
- Return to Sugar's data source management page
- Enter the data source connection information, as shown in the figure below
- Click "test connection" to verify whether the data source can connect normally
- Click "add" to add the data source successfully
- Name: the display name of the data source, which you can fill in as you wish
- Description: you can add a comment description of the data source or leave it blank
- Database address host: the network address, IP or domain name of the database. SaaS version should be able to access the address on the public network
- Port number: the port number of the database
- Database name: database name
- User name: user name of the database
- Password: password corresponding to user name