cancel
Showing results for 
Search instead for 
Did you mean: 

Accessing my database after the change

Dducks
Newbie
Posts: 4
Registered: ‎22-12-2007

Accessing my database after the change

Hi
This post may be a bit confused - I don't use cgi much but have plans for greater use.  I don't understand what has happened after the recent change.
1 An example of my use prior to the change was a php file to access a database that started with: 
.......
$db_host = "rumpus";
$username = "<my_user_name>";
$password = "xxxxxxxxxxxx";
$DB_name = "<my_user_name>_pn";
..........
This code still does what it it has always done, so the database is still being accessed correctly.
2  But if I open up phpMyAdmin it gives the server as sql5c51a.megsqlservers.eu and the database as <my_user_name>_pn_ccgi_plus_com.
What does this mean for any new php code I write? What do I use for db_host and DB_name?
I would be grateful for some guidance here.
Many thanks
David
4 REPLIES 4
jtonline
Grafter
Posts: 73
Thanks: 6
Registered: ‎21-03-2008

Re: Accessing my database after the change

The details you have at the top of your post relates to the 'rumpus' server on the old cgi service.  The old stuff is still accessible, but only until such time as everyone has been successfully migrated to the new ccgi service.
The new ccgi service uses a new server and a new MySQL database will have been created for you, so the details in your php code should be changed to:
[tt]
$db_host = "sql5c51a.megasqlservers.eu";
$username = "<ccgixxxxxxxxxxxx>";
$password = "xxxxxxxxxxxx";
$DB_name = "username_pn_ccgi_username_plus_com";
[/tt]
Your new Database User name ($username in the example above) can be found on your phpMyAdmin screen.  The new Database Password ($password in the example above) should have been written into one of your website’s configuration scripts by PlusNet as part of the migration process.
spraxyt
Superuser
Superuser
Posts: 10,063
Thanks: 1,369
Fixes: 75
Registered: ‎06-04-2007

Re: Accessing my database after the change

To complement what jtonline has just posted:
Your files and database tables have been migrated to new Hostopia website and MySQL servers. Although your website is on a different server its DNS entries have been changed so that the same URLs are used to access it. However this approach can't be used for migrated databases, and completely changed connection information is needed.. To avoid users having to change this information themselves the migration team have amended database settings in your files, so everything should continue to work.
If you check configuration file settings in your files what you see is the information you now need to use for accessing the new database. This is the information you need to use in any new PHP code you write. All four of the values you listed will have changed (ie including database username and password).
David
David
Dducks
Newbie
Posts: 4
Registered: ‎22-12-2007

Re: Accessing my database after the change

Many Thanks for these replies.  They've clarified the situation for me.
I'm not sure precisely where the configuration files you're refering to are, but I'll have a look around my files to find them.
David
spraxyt
Superuser
Superuser
Posts: 10,063
Thanks: 1,369
Fixes: 75
Registered: ‎06-04-2007

Re: Accessing my database after the change

Quote from: Dducks
1 An example of my use prior to the change was a php file to access a database that started with: 
.......
$db_host = "rumpus";
$username = "<my_user_name>";
$password = "xxxxxxxxxxxx";
$DB_name = "<my_user_name>_pn";
..........
This code still does what it it has always done, so the database is still being accessed correctly.

Without knowing what application you are using I can't be more specific, but in the example you mentioned a php file starting with those lines. If you find the same file on the new server and check its contents you should find they have been changed to those needed to access the new database. The file should be in the same relative location as on the Plusnet ccgi server but starting from your /public directory (rather than /).
You can view files on the new server using the File Manager application in Control Panel.
David
David