简体   繁体   中英

Cpanel MySQL database credentials

I've purchased a web hosting and the guy gives me the link of my hosting and I've added my domain against it; now I am trying to create MySQL database in it. I've created a database in MySQL and by clicking on phpmyadmin in cpanel it navigates me to the database, but I am not able to see its credentials and so that I could write those in code or configure my navicat. I've created a database and also a user in cpanel and have assigned all the privileges to the user, but I'm still not able to access the database in navicat. My navicat configurations are:

User Name/IP Address: localhost
Port: 1433
User Name: database name
Password: password the cpanel give me while adding a user.

Please let me know where I am mistaken.

EDIT:

even the console rejects the credentials, my config_db is:

var Sequelize = require('sequelize');

var sequelize = new Sequelize('database name', 'userName', 'userPassword', {
      host:"localhost",


      dialect: "mysql", // or 'sqlite', 'postgres', 'mariadb'
      port:    1334, // or 5432 (for postgres)
 });

module.exports = {  

    dbase: sequelize,


};

and the image of console is:

控制台拒绝mysql凭证

and the code where i'm trying to access the table and try to execute the inset sql query is (the controller file):

 client_login: function (req, res) {


     sequelize.query("INSERT INTO `t_user_Information` ( `id`, `user_name` , `user_password`) VALUES ('NULL', 'login' , 'passWordParam')");

              res.json({status: 'success', message: 'success' , has_agreed:resUserInfo.dataValues.has_agreed, password_reset: resUserInfo.dataValues.password_reset});
              console.log('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>  Done  <<<<<<<<<<<<<<<<<<<<<<<<')
});
  • To access your server from your local system, your server should have MySQL remove access enabled.
  • Check if your Port is not blocked by some firewall.
  • If you created the username and database separately in cPanel, step to next process - and assign the user to that database (both in drop down lists).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM