MySQL is a powerful database management system used by some of the largest organizations in the world, including Facebook, Google, and Amazon. MySQL is an open-source relational database management system (RDBMS), as well as a popular choice for web applications used by millions of websites.
Some applications that can be built using the MySQL API include:
import mysql from 'mysql2/promise';
export default defineComponent({
props: {
mysql: {
type: "app",
app: "mysql",
}
},
async run({steps, $}) {
const { host, port, username, password, database } = this.mysql.$auth
const connection = await mysql.createConnection({
host,
port,
user: username,
password,
database,
});
const [rows] = await connection.execute('SELECT NOW()');
return rows
},
})
Emit new event when you add or modify a new row in a table. See the docs here
Emit new event when new rows are returned from a custom query. See the docs here
Emit new event when a new table is added to a database. See the docs here
MySQL uses API keys for authentication. When you connect your MySQL account, Pipedream securely stores the keys so you can easily authenticate to MySQL APIs in both code and no-code steps.
Before you connect to your MySQL database from Pipedream, please make sure your database is either:
Accessible from the public internet (You may need to add a firewall rule on 0.0.0.0/0
on port 3306), or
Accessible from an SSH server that you route MySQL requests through
After that, enter the following values:
3306
, unless you run MySQL on a different port