Welcome Guest, Not a member yet? Register   Sign In
2 MySQL Database
#1

[eluser]paparts[/eluser]
Hi,

I was searching the forum and did not find any solutions for my problem so I decided to post this question. I have my files in hosting 1 and I want to get data on hosting 2. How do I connect the database? I tried this one http://jedidiahreeser.com/blog/ but I guess it only works on one hosting.
#2

[eluser]rogierb[/eluser]
Did you change the $db['second']['hostname'] to the second host IP? And is your database on host 2 allowed to be accessed from you IP on host 1?

Check these settings, the http://jedidiahreeser.com/blog/ method should work if your database settings are correct.
#3

[eluser]paparts[/eluser]
Thank you for the quick reply. How do I check if the IP on host 1 is allowed to access host 2 database? I changed the settings on for host 2 but I get some errors.

Before I uploaded my files on the host 1 and host 2 I tried everything on my local webserver and everything works very well. That is using only one hosting with 2 different database.
#4

[eluser]rogierb[/eluser]
Assuming you have phpmyadmin on host 2, go to privileges and check if the user you connect with has either a % or a seperate entry with the IP from host 1. If there is only an entry with 'locahost' host 1 does not have access.
#5

[eluser]paparts[/eluser]
Hi I can see in the privileges only the default account >localhost >root >pass host 1's IP on host but still cant access data on host 2.
#6

[eluser]paparts[/eluser]
How do I add access on host2 so host1 can access?
#7

[eluser]rogierb[/eluser]
You should never ever connect to a database as a root user. If you have one weak spot in your app, someone can access all of your databases.

Create a new user on host 2 with the host set to the IP from host 1, give the user priveliges to the database you want to connect to. Then use the new data in you CI connection.

So on host 2 you have userConfusedomeuser host:192.168.0.1(host 1 IP) privileges: Usage




Theme © iAndrew 2016 - Forum software by © MyBB