Mysql method to test whether the database connection is successful: first open all relevant ports; then restart iis, the code is [$link = mysql_connect('localhost', 'root', '123456');].
The operating environment of this tutorial: Windows 7 system, mysql version 8.0.22, DELL G3 computer. This method is suitable for all brands of computers.
Related free learning recommendations: mysql video tutorial
Mysql method to test whether the database connection is successful:
Test whether the database is connected successfully The connection is successful
If
Fatal error: Calltoundefinedfunctionmysql_connect() in ......”
appears, don’t panic
We will
;extension=php_dba.dll ;extension=php_gd2.dll ;extension=php_mbstring.dll ;extension=php_mcrypt.dll ;extension=php_mysql.dll ;extension=php_mysqli.dll ;extension=php_pdo.dll ;extension=php_pdo_mysql.dll ;extension=php_mbstring.dll ;extension=php_gd2.dll ;extension=php_mysql.dll ;extension=php_mcrypt.dll
enable all
and then restart iis. It will be successful
连接数据库
The above is the detailed content of How to test whether the database connection is successful in mysql. For more information, please follow other related articles on the PHP Chinese website!