I am getting Following error in my CodeIgniter application which is live on server.
Here is the output of the error:
A PHP Error was encounte
u can add new user and pass and give it all privileges, like below:
CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON *.* TO 'newuser'@'localhost';
FLUSH PRIVILEGES;
then, u should update your config.php file, with new user and pass.
Do the following:
applications/config/database.php
, add dbport => '3306',
to the default array $db['default'] = array();
system/database/DB_driver.php
, change public $port = '';
to public $port = '3306';
$db['default'] = array(
'dsn' => '',
'hostname' => 'localhost',
'username' => 'root',
'password' => '',
'database' => 'xxx',
'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
);
You can edit your server's php.ini file to define the port that CodeIgniter will use by default.
C:\wamp64\bin\apache\apache2.4.41\bin\php.ini
Default port number for mysqli_connect()
.
mysqli.default_port = 3308
Try to use the plain password with no special characters, below is the example:
$db['default'] = array(
'dsn' => '',
'hostname' => 'localhost',
'username' => 'password',
'password' => 'Mynewpass@756',
'database' => 'database_name',
);
Try to set config/database.php 'username' => 'xxx' to 'username' => 'root' without any password.
$db['default'] = array(
'dsn' => '',
'hostname' => 'localhost',
'username' => 'root',
'password' => '',