Page 1 of 3

Forsaken sanctum mysql and 000webhost help

Posted: Wed Jun 09, 2010 9:30 pm
by Baseball435
Hey everyone, I wanted to upload forsaken sanctum onto the Internet just to test it to see if I can actually get it running on the Internet. So I used 000webhost.con and I change the connect.php file to my 000webhost mysql database and I changed the root to the username and my password and I uploaded all of the files including setting up everything in mysql phpmyadmin which they supply for you. So i went to the website and I keep getting an error and idk why, the website is fsanctum.site90.net . Help please?

Here's the error!


PHP Error Message

Warning: mysql_connect() [function.mysql-connect]: Host 'srv19.000webhost.com' is not allowed to connect to this MySQL server in /home/a6977875/public_html/connect.php on line 3

Could not connect.

Re: Forsaken sanctum mysql and 000webhost help

Posted: Wed Jun 09, 2010 9:46 pm
by Chris
I'm guessing you are using the wrong host.

The function should be

Code: Select all

$db = mysql_connect("host", "username", "password") or die("Could not connect.");
 
You might also need to add the port at the end of the host, eg:

Code: Select all

$db = mysql_connect("host:3306", "username", "password") or die("Could not connect.");
 

Re: Forsaken sanctum mysql and 000webhost help

Posted: Wed Jun 09, 2010 10:12 pm
by SpiritWebb
You need to create a database through 000webhost, this will allow you to create a username and password, and will give you the host name.

Then with that information you need to change the

Code: Select all

$db = mysql_connect("host:3306", "username", "password") or die("Could not connect.");
to

Code: Select all

$db = mysql_connect("host name given", "your username you chose", "your password you chose") or die("Could not connect.";

Re: Forsaken sanctum mysql and 000webhost help

Posted: Wed Jun 09, 2010 11:02 pm
by Baseball435
Yeah I did all of that, except my host is like random numbers and letters then _forsaken. Is that correct or is it supposed to be like host:####

Re: Forsaken sanctum mysql and 000webhost help

Posted: Thu Jun 10, 2010 12:05 am
by SpiritWebb
The random numbers and then _forsaken. It is put there in place so it will read your database. those random numbers are your username basically.

Re: Forsaken sanctum mysql and 000webhost help

Posted: Thu Jun 10, 2010 12:26 am
by Baseball435
SpiritWebb wrote:The random numbers and then _forsaken. It is put there in place so it will read your database. those random numbers are your username basically.
ok That what's I thought

Re: Forsaken sanctum mysql and 000webhost help

Posted: Thu Jun 10, 2010 12:39 am
by hallsofvallhalla
you sure you got the username and pass correct?

Re: Forsaken sanctum mysql and 000webhost help

Posted: Thu Jun 10, 2010 12:40 am
by Baseball435
Ok this is all of my information, without the info next to it obviously. Only the mysql stuff. The user and pass is the mysql user and pass though. Idk what the host is still. If anyone has a different webhost that's free tell me it. But here's the INfo

Domain
Username
Password
Disk Usage
Bandwidth
Home Root
Server Name
IP Address
Apache ver. 2.2.13 (Unix)
PHP version 5.2.*
MySQL ver. 5.0.81-community
Activated On
Status Active

Re: Forsaken sanctum mysql and 000webhost help

Posted: Thu Jun 10, 2010 2:36 am
by SpiritWebb
Click on MySQL in your cPanel, you should see the following:


Manage MySQL Databases

MySQL databases are required by many web applications including bulletin boards, content management systems, and others. To use MySQL, you need to create database and user, which will be automatically assigned to this database. Click for phpMyAdmin when database is created.

Important: MySQL Host for any database in this account is *******, do not use localhost!

The **** section is your host. Use this in place of localhost.

EDIT: I stared my host out, but you will see yours.

Re: Forsaken sanctum mysql and 000webhost help

Posted: Thu Jun 10, 2010 2:57 am
by Baseball435
Yesss thank you so much spiritwebb. Now it's working