Authentication
This provider requires authentication.
- username: MySQL username (required: True, sensitive: False)
- password: MySQL password (required: True, sensitive: True)
- host: MySQL hostname (required: True, sensitive: False)
- database: MySQL database name (required: False, sensitive: False)
- port: MySQL port (required: False, sensitive: False)
Certain scopes may be required to perform specific actions or queries via the provider. Below is a summary of relevant scopes and their use cases:
- connect_to_server: The user can connect to the server (mandatory)
In workflows
This provider can be used in workflows.
As “step” to query data, example:
steps:
- name: Query mysql
provider: mysql
config: "{{ provider.my_provider_name }}"
with:
query: {value} # Query to execute
as_dict: {value} # If True, returns the results as a list of dictionaries
single_row: {value} # If True, returns only the first row of the results
# Arguments will me passed to the query.format(**kwargs)
As “action” to make changes or update data, example:
actions:
- name: Query mysql
provider: mysql
config: "{{ provider.my_provider_name }}"
with:
query: {value} # Query to execute
as_dict: {value} # If True, returns the results as a list of dictionaries
single_row: {value} # If True, returns only the first row of the results
# Arguments will me passed to the query.format(**kwargs)
Check the following workflow examples:
Connecting with the Provider
In order to connect to the MySQL database, you will need to create a new user with the required permissions. Here’s how you can do this:
- Connect to the MySQL server as a user with sufficient privileges to create a new user.
- Run the following command to create a new user:
CREATE USER '<username>'@'<host>' IDENTIFIED BY '<password>'
;
- Grant the necessary permissions to the new user by running the following command:
GRANT ALL PRIVILEGES ON <database>.* TO '<username>'@'<host>'
;
Notes
Useful Links
Responses are generated using AI and may contain mistakes.