Ecommerce Shopify WordPress Discussion

I am trying to connect phpmyadmin database to node js app but but getting error

I am acually remaking a wordpress site from scratch with React (for frontend) , Node and express (for backend). There are a lot of post on the current wordpress site database and i want to use the same database and will just use Node and express to create, read, update or delete posts. I see the phpmyadmin panel but there is a big mess (3 database and 20+ tables on each database and a lot of entry on each table) of data and i don't know where is the real post and what should i do now. I try this code to connect with the database const mysql = require('mysql'); const connection = mysql.createConnection({ host: 'localhost', user: 'user_name', password: 'password', database: 'database name' }); connection.connect((err) => { if (err) { console.error('Error connecting to the database:', err); return; } console.log('Connected to the database'); }); module.exports = connection; Run code snippetExpand snippet when i run this code this give me a error Error: ER_ACCESS_DENIED_ERROR: Access denied for user 'my_user_name'@'localhost' (using password: YES) i am getting all the connection data(user, password, database, host) from wordpress file manager wp-config.php and now don't know how to make the backend with node. Please anyone know what to do next help me to create the backend???
try this approach const pool = mysql.createPool({ connectionLimit : 10, host : 'localhost', user : 'user name', password : 'password', database : 'database name' }) pool.getConnection((err, connection) => { if(err) throw err console.log(`connected as id ${connection.threadId}`) connection.query('SELECT * from users', (err, rows) => { connection.release() // return the connection to pool if(!err) { res.send(rows) } else { console.log(err) } }) })

January 17, 2024

I figure it out. You just have to give you're remote host name which you'll find on cpanel and you have to add you're local ip adress to the remote mysql host.

January 17, 2024

TurboCommerce make the better internet purchasing globaly

Turbo Multi-language Translator

Make the better internet purchasing globaly

Turbosify SEO Speed Booster

5.0 (7) Free plan available
Get better conversions by improving store loading speed Installed

Turbo Multi-language Chat - AI Customer service in one hand

TurboCommerce make the better internet purchasing globaly
Our products

The help you need, when you need it

App by Turbo Engine

3 apps • 5.0 average rating

Turbosify Speed Booster

5.0 (7)
Get better conversions by optimizing shopify store Google page speed Installed

Turbosify Translator for Wordpress Woocommerce

5.0 (74) Free Wordpress Woocommerce Plugin
Translate your wordpress website to multiple language within 1 click, no configuration needed, no No technical required

Grow your business here

Whether you want to sell products down the street or around the world, we have all the tools you need.