Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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 encountered

Severity: Warning

Message: mysqli::real_connect(): (HY000/1044): Access denied for user 'xxx'@'localhost' to database 'xxx'

Filename: mysqli/mysqli_driver.php

Line Number: 161

Backtrace:

File: /home/arya123/public_html/application/controllers/Home.php Line: 7 Function: __construct

File: /home/arya123/public_html/index.php Line: 292 Function: require_once

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
1.1k views
Welcome To Ask or Share your Answers For Others

1 Answer

you have to set mysql port number which is by default 3306 check this in database.php

use either

'dbport' => '3306',

or

 'hostname' => 'mysql.hostingprovider.com:3306',   

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...