Software:
This is my PHP code:
try {
$link = mysqli_connect($DB_SERVER,$DB_USERNAME, $DB_PASSWORD,$DB_NAME,3306);
} catch (Exception $e){
throw new Exception("Can't execute command. ERROR: ".$e);
}
This is the error:
Warning: mysqli_connect(): PHP was built without openssl extension, can't send password encrypted in login.php on line 11
Warning: mysqli_connect(): (HY000/1045): Access denied for user 'XXXXX_admin'@'localhost' (using password: YES) in C:\\inetpub\\wwwroot\\ on line 11
PHP Warning: mysqli_error() expects parameter 1 to be mysqli, boolean given in C:\\inetpub\\wwwroot\\ on line 24
PHP Fatal error: Uncaught Exception: ERROR: Failed to connect to in C:\\inetpub\\wwwroot:24 Stack trace: #0 {main} thrown in C:\\inetpub\\wwwroot\\ on line 24
Now the magic, when I login in to mysql workbench with the same user and password everything works fine. I have access to tables and other things. When I login in with my PHP application everything works also.
So my problem is everytime my server reboots I have to login in with MySQL Workbench, to get it working again. What am I missing?
You need to do verify few of the steps:
mysqli
, openssl
etc MySQLi
is connecting at 3306 Port username
and password
issue Let us know once you will be verifying all above steps.
What you need to do is enable the openssl extension for php.
Open your php.ini
file and search for the line:
;extension=php_openssl.dll
You need to uncomment it by removing the semicolon in front of it, leaving you with this:
extension=php_openssl.dll
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.