1

I have a problem when I am trying to connect my project to PHPMYADMIN

const mysql = require('mysql');
var con = mysql.createConnection({
    host: "localhost",
    user: "root",
    password: "",
    database: "edu_app",
    port: "3306"

});
con.connect();

  • i didnt understand what should i do ? – Mahmoud mashaal yesterday
  • you can't run mysql library in browser (directly in vue code), you have to create some api that will connect to database and expose data. – Robert yesterday
  • Where are you attempting to run this code? In a browser or in nodejs? That fact that you tagged it vue.js makes me think you're bundling this code and trying to run it in the front-end and the error you're getting sounds like there is no net module which would also be consistent with trying to run it in the front-end. You can't run mysql in the front-end. It only runs in the back-end. – jfriend00 yesterday

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.