|
Planet MySQL
|
Planet MySQL - https://planet.mysql.com
|
-
NodeJS MySQL Drop Table
DROP TABLE crashed my Node process when I re-ran it without a guard, and the fix turns that crash into a warning. I built every code path below on Node 26.7.0 with mysql 2.18.1 and mysql2 3.24.4 against MariaDB 10.11.14. I captured the terminal output as images so what you run matches what I saw. […]
-
NodeJS MySQL Create Table
I ran node app.js once and the users table appeared, then I ran it again and MySQL returned Table users already exists. If you copy the Node.js MySQL create table snippet from an older tutorial you expect it to be safe to rerun because the code looks like any other setup script, so the duplicate […]
-
NodeJS MySQL Create Database
Node.js can create a MySQL database with one query, but the connection that runs it has to be set up without naming a database first. I hit ER_DB_CREATE_EXISTS on the next run because my first draft skipped IF NOT EXISTS, which means the same script blows up the moment you re-run it. The safe path […]
-
NodeJS MySQL Create Connection
I rebuilt this MySQL connection from scratch on Node 26 with mysql2 3.24.4 because the old page still taught the unmaintained mysql package. It left every error to a throw that crashes your process. I ran each snippet below against a local MariaDB 10.11 on 3306, so every ER_ACCESS_DENIED_ERROR you see came from a run […]
-
Node.js and MySQL Connection Pool Example
I threw a per-request MySQL connection into a small Node API and watched it limp under concurrent load, so I rebuilt it with a mysql2 pool and kept the receipts. I created the pool with createPool on Node v26.7.0 and mysql2 3.24.4, ran pool.query and pool.getConnection against a local host, and got ER_ACCESS_DENIED_NO_PASSWORD_ERROR back because […]
|