Why can't my server connect MYSQL database when I can access and ssh it?

Advertisements I’m setting up my server and I can connect to the DB using `mysql -u root -p` and by ssh from outside the server. But I am getting `SQLSTATE[HY000] [1045] Access denied for user ‘root’@’localhost’ (using password: YES)` when I start my server. I have no clue why this is happening. I am able… Read More Why can't my server connect MYSQL database when I can access and ssh it?

bind() error 98 – "Address already in use"

Advertisements If i start local server on Linux, i get "Address already in use" error. I use setsockopt(SO_REUSEADDR) but it doesn’t help. How can i solve this problem? Code: #include <iostream> #include <sys/socket.h> #include <sys/un.h> #include <unistd.h> using namespace std; int main() { sockaddr_un s_addr; s_addr.sun_family = AF_UNIX; strcpy(s_addr.sun_path, "server"); int s_descriptor = socket(AF_UNIX, SOCK_STREAM,… Read More bind() error 98 – "Address already in use"

External script.js doesn't run in html

Advertisements I have an https server. It works except for the external script.js. But if the script is internal, it works. My server.js file: const https = require("https"); const fs = require("fs"); const options = { key: fs.readFileSync(‘server.key’), cert: fs.readFileSync(‘server.cert’), }; https.createServer(options, (req, res) => { res.writeHead(200); res.end(fs.readFileSync(‘index.html’)); }).listen(8000, "localhost"); My index.html file: <!DOCTYPE html>… Read More External script.js doesn't run in html

Temporary data in Firebase

Advertisements I need a solution for storing userIds and deleting the data every 24 hours in a Firebase function. What’s the best practice for this case? >Solution : Firebase has a special system for this Example: exports.scheduledFunction = functions.pubsub.schedule(‘every 5 minutes’).onRun((context) => { console.log(‘This will be run every 5 minutes!’); return null; }); More info… Read More Temporary data in Firebase