CodeIgniter Forums

Full Version: Database Connection Problem
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2

El Forum

[eluser]macleodjb[/eluser]
I was curious. I'm having trouble connecting to my database while working locally on my PC. What i have been doing is just working with localhost on my web server and it works fine but then i'm making changes to a live website which is bad. I would like to work locally then upload my file all at once but i'm unable to do so until i can resolve this issue.

When i use mysql administrator from my local PC i can connect fine to my database which requires my IP address and port number 3036. I tried different variations of the IP and port number with no success. Has anyone else had any problems like this? My hosting company is Hostgator.

El Forum

[eluser]Aniket[/eluser]
did u make changes to config/database.php while putting it live....i mean did u change the username, password ??

El Forum

[eluser]macleodjb[/eluser]
i had to switch it to localhost and put it live because i couldn't get it to work locally eventhough my login information was correct, the only problem i seem to have is the url with attached port setting

El Forum

[eluser]macleodjb[/eluser]
anyone have a possible solution to this problem?

El Forum

[eluser]TheFuzzy0ne[/eluser]
MySQL servers are not always available for outside access. You will be better off asking your host about the problem. They will be able to confirm whether or not they allow outside access to your database.

El Forum

[eluser]macleodjb[/eluser]
i don't have any problem connecting to mysql through mysql administrator from my local pc, it only seems to be a problem with code igniter and entering a port number attached to the ip address

El Forum

[eluser]TheFuzzy0ne[/eluser]
Post 3036 is MySQLs default port number. Why do you need to add this to your configuration? CodeIgniter will use that port by default.

El Forum

[eluser]macleodjb[/eluser]
all i know is that i have mysql administrator works fine. I have the same configuration locally in mysql administrator that i did within codeigniter. The only difference is codeigniter doesn't work with mysql on my local machine. I can connect code igniter to a local copy of mysql with no problem. My problem resides in the fact that i want to alter my files locally while using mysql via IP address. If i haven't been clear when i open my configuration in mysql administrator on my local machine it shows my IP address and port number with my user information. When i come to codeigniter and insert the exact same information whether it's with the port number or not it will not connect, it keeps telling me that it could not connect to the database.

El Forum

[eluser]TheFuzzy0ne[/eluser]
The server can be configured to not allow users to connect to external databases and Web sites. It might be worth asking your server admins about this.

The only other 2 things I can think of, is that a) something is not configured correctly in the CI configuration files, or that a Firewall is getting in the way.

When you refer to your "local server", what do you mean? DO you run a standalone server, or XAMPP?

El Forum

[eluser]macleodjb[/eluser]
I figured out my problem with sql. It was a multi issue. First issue was because for whatever reason my php.ini file was not reading my extensions so i moved them to the windows folder and it connected fine.

Now i have another problem now that i have it working locally on my PC. When i have my file published to my remote server i can use links like this www.site.com/search, but now that i have it locally when i do that i get a 404 error. And it's not the 404 error page from codeigniter. I changed my base url in the config file, i thought that was all i needed to do in order to work locally. What am i missing?
Pages: 1 2