I had issue with upgrading codeignier 2.xx to 3.xx before and I can not found any completed answer for me. So I'd like to share how I solved it.
In Codeignier official web site show how to connect PDO with Mysql as below
For the PDO driver, you should use the $config[‘dsn’] setting instead of ‘hostname’ and ‘database’:
$config[‘dsn’] = ‘mysql:host=localhost;dbname=mydatabase’
https://www.codeigniter.com/user_guide/database/connecting.html
But I still could not make it work as it was showing error
Invalid or non-existent PDO subdriver
Some site shown how to fixe this by add this to hostname
$db ['default'] ['hostname'] = 'mysql:host=localhost';
But I still got error
Error Number: 3D000/1046
No database selected