el9in Posted August 4, 2019 Posted August 4, 2019 (edited) used: < npm update mysql > | < npm -g update mysql > and < npm update -g mysql > console.log("step 0"); var mysql = require('mysql'); var mysqlc = mysql.createConnection({ host:'localhost',// host of server user:'root',// MySQL user password:'',// MySQL password database:'rage_bados'// MySQL database }); mysqlc.connect(function(e) { if(e) { console.log("Error connecting to the database with error "+e); } else { console.log('Database connected!') } }); mysqlc.end(); mysqlc.query("SELECT * FROM `users` WHERE `nickname`=", [], function(e, r) { if(e) { console.log('Error on connection ... '); throw e; } else { console.log('Password is '+r[0].passcode); } }); ERROR: step 0 Error: Error: Cannot find module 'mysql' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15) at Function.Module._load (internal/modules/cjs/loader.js:507:25) at Module.require (internal/modules/cjs/loader.js:637:17) at require (internal/modules/cjs/helpers.js:20:18) at Object.<anonymous> (D:\RAGEMP\server-files\packages\freeroam\index.js:15:13) at Module._compile (internal/modules/cjs/loader.js:689:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10) at Module.load (internal/modules/cjs/loader.js:599:32) at tryModuleLoad (internal/modules/cjs/loader.js:538:12) at Function.Module._load (internal/modules/cjs/loader.js:530:3) Edited August 4, 2019 by el9in
MrPancakers Posted August 4, 2019 Posted August 4, 2019 it's 'npm install mysql' you also need to do it in your root directory of your server 1
el9in Posted August 4, 2019 Author Posted August 4, 2019 10 минут назад, MrPancakers сказал: it's 'npm install mysql' you also need to do it in your root directory of your server How to do it?
el9in Posted August 4, 2019 Author Posted August 4, 2019 32 минуты назад, MrPancakers сказал: it's 'npm install mysql' you also need to do it in your root directory of your server Thanks. Close theme
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now