Registry / database / jovo-db-mysql

jovo-db-mysql

JSON →
library3.6.1jsnpmunverified

MySQL database integration for Jovo v3 framework, enabling storage of user-specific data for Alexa Skills and Google Actions. This package (v3.6.1, stable) is the official MySQL adapter for the Jovo user database layer, supporting configurable table schemas and connection settings. It replaces the deprecated jovo-framework internal MySQL handling. Consider jovo-db-dynamodb as an alternative for serverless deployments. Release cadence is irregular; latest v3.6.1 was published over 2 years ago.

npm install jovo-db-mysql
INSTALL
IMPORT
SIG · JOVO-DB-MYSQL
J
jovo-db-mysql
databasejavascriptv3.6.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

MySQL
import { MySQL } from 'jovo-db-mysql'
const MySQL = require('jovo-db-mysql')
ESM import is correct; CommonJS require returns the module object, not the class. Use destructuring: const { MySQL } = require('jovo-db-mysql')
MySQL
const { MySQL } = require('jovo-db-mysql')
const MySQL = require('jovo-db-mysql').MySQL
Explicit destructuring avoids confusion with default export (nonexistent). The module exports an object with 'MySQL' as a named property.
MySQL
import { MySQL } from 'jovo-db-mysql'
import MySQL from 'jovo-db-mysql'
There is no default export; using default import results in undefined at runtime.

Initializes MySQL database adapter with Jovo app, configures connection and table settings using environment variables.

import { MySQL } from 'jovo-db-mysql'; import { App } from 'jovo-framework'; const app = new App(); // Enable MySQL database integration app.use(new MySQL()); // Configure database connection in config const config = { db: { MySQL: { tableName: 'users', primaryKeyColumn: 'userId', dataColumnName: 'userData', connection: { host: process.env.MYSQL_ADDR || 'localhost', port: process.env.MYSQL_PORT || 3306, user: process.env.MYSQL_USER || 'user', password: process.env.MYSQL_PASSWORD || 'password', database: process.env.MYSQL_DATABASE || 'jovoapp', }, }, }, }; app.setConfig(config);
Debug
Known issues
breakingMissing required peer dependency 'mysql' - the package does not auto-install it
fix
npm install mysql alongside jovo-db-mysql
affects: >=3.0.0
breakingIncorrect import path: using 'jovo-db-mysql' instead of 'jovo-db-mysql' (same) - actually, ensure package name is correct
fix
Use exact package name 'jovo-db-mysql'
affects: all
breakingMySQL connection fails if port is provided as string instead of number
fix
Set port as integer: port: 3306, not port: '3306'
affects: all
deprecatedThis package is in maintenance mode; Jovo v4 uses a different database abstraction
fix
Migrate to Jovo v4 and use its MySQL integration if available, or use jovo-db-dynamodb
affects: >=3.6.0
gotchaTable auto-creation may fail if database user lacks CREATE TABLE privilege
fix
Ensure MySQL user has CREATE privilege or pre-create the table manually
affects: all
gotchaData column name defaults to 'userData' but can be overwritten; misconfiguration leads to missing data
fix
Set dataColumnName to match your table schema
affects: all
Errors
Common errors & fixes
Cannot find module 'mysql'
Peer dependency mysql is not installed
fix
npm install mysql
TypeError: Class constructor MySQL cannot be invoked without 'new'
Forgetting the 'new' keyword when initializing MySQL instance
fix
app.use(new MySQL())
ER_BAD_DB_ERROR: Unknown database 'jovoapp'
Database specified in config does not exist on MySQL server
fix
Create the database manually: CREATE DATABASE jovoapp;
Error: connect ECONNREFUSED 127.0.0.1:3306
MySQL server is not running or host/port misconfigured
fix
Start MySQL service or update host/port in config
Error: ER_ACCESS_DENIED_ERROR: Access denied for user 'user'@'localhost'
Invalid MySQL credentials
fix
Set correct MYSQL_USER and MYSQL_PASSWORD environment variables
Upgrade
Version history
3.6.1latest on npm
Audit
Dependencies
mysqlrequiredMySQL client for Node.js required at runtime to connect to database
jovo-frameworkrequiredPeer dependency for Jovo app integration; required for correct functionality
Agent activity
4 hits · last 30 days
node
4
Resources