使用XAMP进行本地开发,我可以从本地apache服务器成功连接到本地mysql数据库。
但是我需要SSL进行开发,因此我添加了一个本地域(遵循directions之后),该域可以正常工作。 但是现在我无法使用CodeIgniter连接到本地mysql数据库,它返回此错误:
mysqli::real_connect(): (HY000/2002): A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
C:\xampp\htdocs\website\system\database\drivers\mysqli\mysqli_driver.php 203
在my.ini中,我设置bind-address =“ 0.0.0.0”并注释了#skip-networking
我向mysql添加了一个用户,并尝试使用codeigniter上的这些凭据进行连接:
'dsn' => '',
'hostname' => 'localhost',
'username' => 'testuser',
'password' => 'passwordtest',
'database' => 'database_test',
'dbdriver' => 'mysqli',
'dbprefix' => '',
'pconnect' => FALSE,
'db_debug' => (ENVIRONMENT !== 'production'),
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE,
'failover' => array(),
'save_queries' => TRUE
我还尝试使用127.0.0.1和127.0.0.1:3306作为主机名