I am stuck at a point where I need to ask for some assistance as this is my first time working with an external database using PHP. I get the following error when running my PHP script.
mysqli::__construct(): (HY000/1045): Access denied for user 'user'@'localhost' (using password: YES)
The PHP script I am trying to execute:
shell_exec("ssh -f -L 3307:127.0.0.1:3306 [email protected] sleep 60 >> logfile");
$mysqli = new mysqli($servername, $username, $password, $dbname);
$sql = $mysqli->prepare("INSERT INTO users (name, email, password, first_name, last_name, cell_no) VALUES (?, ?, ?, ?, ?, ?)");
$sql->bind_param("ssssss", $loginUsername, $emailAddress, $sitePass, $firstName, $lastName, "cellNr");
$sql->execute();
Any assistance would be greatly appreciated.
question from:
https://stackoverflow.com/questions/65879285/interacting-with-an-external-db-using-php-and-ssh 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…