Mysqli on WAMP, error - connection attempt failed - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: Mysqli on WAMP, error - connection attempt failed (/showthread.php?tid=63884) |
Mysqli on WAMP, error - connection attempt failed - StudentX - 12-18-2015 Hello Everybody, I am working on my first Codeigniter project. Recently I migrated this project to Windows 10 from Windows 7, in Windows 7, I was working with manual installation of Apache, PHP, Mysql but in Windows 10 I installed WAMP. And I am getting following error message in this new setup. The page keeps on loading and loading and then fails with the error message. The mysqli extention is installed and loaded. Quote:A PHP Error was encountered Further done the page this is the message I get : Quote:Unable to connect to your database server using the provided settings. If I change 'dbdriver' => 'mysqli', part of the config to 'dbdriver' => 'mysql', then it works but shows a warning of deprecated mysql extension. Code: $db['default'] = array( I checked my phpinfo and the mysqli is installed. I checked it with the following code and it is working. Code: <?php 1. wamp icon > php > php_extensions > php_mysqli 2. extension=php_mysqli.dll in php ini is un-commented. 3. The extension_dir" c:/wamp/bin/php/php5.5.12/ext/ is correct for my php version install. 4. I tried it with the fresh install of the codeigniter, simply adding $this->load->database ( ) to the default controller triggers the same error. I created a virtual host for this project do here is info about it. HOST file : Code: 127.0.0.1 localhost Apache httpd-vhosts.conf file : Code: <VirtualHost *:80> Project .htaccess file : Code: <IfModule mod_rewrite.c> So, how do I make mysqli work for codeigniter ? RE: Mysqli on WAMP, error - connection attempt failed - StudentX - 12-18-2015 No one ? Could it be a BUG ? RE: Mysqli on WAMP, error - connection attempt failed - arma7x - 12-19-2015 Have you try 127.0.0.1 as hostname? Not sure if it's works or not.. RE: Mysqli on WAMP, error - connection attempt failed - InsiteFX - 12-19-2015 I had the same problem when I upgraded to Windows 10 on XAMPP If your running any kind of remote software like Skype and Team Viewer you need to change the port number to something other then port 80. Also try re-installing WAMP and see if it will connect. After re-installing XAMPP several times it did finally work. |