Critical error: Unknown MySQL host Critical error: Unknown MySQL host
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Critical error: Unknown MySQL host

Started by SnuppyNusser, July 17, 2015, 03:38:49 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

SnuppyNusser

I need a bit help here. Recently (in June), I moved my domain to a new host. That took me 1½ month to get moved along with my data.
Now that everything should be settled and ready, there's this one problem when I try enter the gallery:

Coppermine critical error:
Unable to connect to database !

MySQL said: Unknown MySQL server host 'judefans.net.mysql' (0)

I have tried several times to contact my new host to get help and support on solving this. But they doesn't seem to wanna help me out and I really don't feel like delete the gallery after 1 year of dedicated work and re-install everything.
Anyone knows how to fix this? The domain is http://judefans.net/gallery

Stramm

Try
1. localhost
2. your IP
or
3. your domain name
as MySQL host.

If that doesn't help you need to wait for your support guys.

SnuppyNusser

Quote from: Stramm on July 17, 2015, 07:14:39 PM
Try
1. localhost
2. your IP
or
3. your domain name
as MySQL host.

If that doesn't help you need to wait for your support guys.
How do I try all 3 steps? As I'm not 100% sure I know what you mean..
But thank you for the reply :)

gmc

Coppermine database connection info is stored in yourgalleryurl/include/config.inc.PHP
You need to edit this file (either on your server via your ISP's control panel tools, or locally on your pc and then publish to site.)

This line points to the database:

$CONFIG['dbserver'] = 'judefans.net.mysql';      // Your database server

Change the assigned value to 'localhost' or one of Stramm's other suggestions....
You may also need to change the dbuser, dbpass, and dbname to match the credentials at your new hosting site.
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

SnuppyNusser

So, I need to create a new MySQL database with new user/pass and info and than direct it to localhost as well?
Do I need to create a table name prefix? Cause I already tried but failed, as it didn't come along with the database..

phill104

No, you should hopefully have a database already setup with all the data from your previous host. You simply need to provide the credentials to point to that.
It is a mistake to think you can solve any major problems just with potatoes.

Αndré

You need to import your existing Coppermine database to your new MySQL server (if it doesn't already exist) and then adjust the database credentials in include/config.inc.php. The table prefix won't change, but the database server, database name, user name und user password will probably differ from your old setup.

SnuppyNusser

Sadly, my new host didn't move the datas from my old host to theirs and I already cancelled my previous host, so my account will be deleted around august-september..

Besides, I already compared my file to another gallery file of mine and they didn't look quite the same.. The info was similar, but the order was different..

That's why I thought it would be easier solution to just create a new mysql and add it to the config file..

Αndré

Quote from: SnuppyNusser on July 20, 2015, 12:37:21 PM
I already cancelled my previous host, so my account will be deleted around august-september..

Then you should hurry and backup your database!


Quote from: SnuppyNusser on July 20, 2015, 12:37:21 PM
That's why I thought it would be easier solution to just create a new mysql and add it to the config file..

This is equal to a new Coppermine installation (i.e. a blank gallery without any content).

SnuppyNusser

Quote from: Αndré on July 20, 2015, 12:44:18 PM
Then you should hurry and backup your database!

This is equal to a new Coppermine installation (i.e. a blank gallery without any content).
Don't get me wrong.. All files and content has been moved to my new host, but the mysql databases did my new host leave at the old host and didn't create a new one..

So, how exactly am I supposed to move the mysql info from my old soon-cancelled host to the new account?
I'm not quite sure I understand this :-\

By the way, let me know if anyone needs a screenshot of anything :)

SnuppyNusser

Sorry for double posting, but I couldn't find an edit button to update my last reply..
I was just wondering what happens IF I create a new mysql database from my new host and add the info to the config file? Will it still just appear blank and it's impossible to safe or can I still save it that way?

That's just an addictional question to my last response :)

Αndré

There are basically 3 tasks to do:
1. Backup database on your old server
2. Restore database on your new server
3. Adjust credentials in include/config.inc.php

Please also have a look at http://documentation.coppermine-gallery.net/en/export.htm#moving_server

My recommendation for backup/restore a MySQL database via your browser is MySQLDumper: http://www.mysqldumper.net/


Quote from: SnuppyNusser on July 20, 2015, 03:15:36 PM
what happens IF I create a new mysql database from my new host and add the info to the config file?
Coppermine will display an error message that it cannot find mandatory tables.

SnuppyNusser

Oh boy.. Considering I'm trying my best to backup the gallery in the right way, it just seems like a very complicated process that might take longer time..
So far, I have SQL and PHP files of the entire gallery, which I hope is correct..

If all of this fails in the end, that I did something wrong and time's up from my old cancelled host, is it than possible that I create a new photogallery from scratch at my new host and just starts over?
Cause right now, it seems to be the easiest choice to do..

Αndré

Quote from: SnuppyNusser on July 20, 2015, 05:06:41 PM
I have SQL and PHP files of the entire gallery, which I hope is correct..

If you're talking about the 3 .sql files in the "sql" folder, that's not the backup of your database.



Quote from: SnuppyNusser on July 20, 2015, 05:06:41 PM
is it than possible that I create a new photogallery from scratch at my new host and just starts over?
Cause right now, it seems to be the easiest choice to do..

Of course you can always start a new gallery from scratch, but that's not the best option in my opinion. Actually, you even can run several galleries on the same server & domain simultaneously.

phill104

I've sent you a PM. If you wish I have a little free time tomorrow. Send me your cpanel details of your OLD host and I will take a backup of your DB for you. Once I have that send me details of your new host and I will restore it for you.
It is a mistake to think you can solve any major problems just with potatoes.

SnuppyNusser

Quote from: Phill Luckhurst on July 20, 2015, 05:40:34 PM
I've sent you a PM. If you wish I have a little free time tomorrow. Send me your cpanel details of your OLD host and I will take a backup of your DB for you. Once I have that send me details of your new host and I will restore it for you.
Thank you so much :D That's so kind of you..
I'll send an e-mail later today with the info.. :)

phill104

Hopefully that is all OK now. Please learn how to use PHPmyadmin or MySqldumper from your cPanel and take regular backups of your db and files. If you look at the config.inc.php file you will see the database I have used (hopefully that is the one you wanted to be used, it was empty so I assumed it would be OK) and I have setup the user detailed in that file just for this.

Please make sure you run http://judefans.net/gallery/update.php as soon as possible to make sure everything us up to date and correct in its new location.
It is a mistake to think you can solve any major problems just with potatoes.

SnuppyNusser

Quote from: Phill Luckhurst on July 21, 2015, 12:54:29 AM
Hopefully that is all OK now. Please learn how to use PHPmyadmin or MySqldumper from your cPanel and take regular backups of your db and files. If you look at the config.inc.php file you will see the database I have used (hopefully that is the one you wanted to be used, it was empty so I assumed it would be OK) and I have setup the user detailed in that file just for this.

Please make sure you run http://judefans.net/gallery/update.php as soon as possible to make sure everything us up to date and correct in its new location.
Thank you very much for helping me out and saving my gallery :D
I thought I knew how to backup any database, but it seems like I was wrong and didn't know how to.. I guess I will learn it with the time than - hopefully I will :)

I did run the update and everything looked fine.. I also uploaded new content without problems, so it seems like everything is working well now :)