Forsaken sanctum mysql and 000webhost help

Need help with an engine or coding not on the list? Need help with a game or the website and forums here? Direct all questions here.
Baseball435
Posts: 548
Joined: Sun May 30, 2010 3:49 am

Forsaken sanctum mysql and 000webhost help

Post 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.
User avatar
Chris
Posts: 1581
Joined: Wed Sep 30, 2009 7:22 pm

Re: Forsaken sanctum mysql and 000webhost help

Post 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.");
 
Fighting for peace is declaring war on war. If you want peace be peaceful.
User avatar
SpiritWebb
Posts: 3107
Joined: Sun Jul 12, 2009 11:25 pm

Re: Forsaken sanctum mysql and 000webhost help

Post 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.";
Image

Image
Baseball435
Posts: 548
Joined: Sun May 30, 2010 3:49 am

Re: Forsaken sanctum mysql and 000webhost help

Post 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:####
User avatar
SpiritWebb
Posts: 3107
Joined: Sun Jul 12, 2009 11:25 pm

Re: Forsaken sanctum mysql and 000webhost help

Post 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.
Image

Image
Baseball435
Posts: 548
Joined: Sun May 30, 2010 3:49 am

Re: Forsaken sanctum mysql and 000webhost help

Post 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
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: Forsaken sanctum mysql and 000webhost help

Post by hallsofvallhalla »

you sure you got the username and pass correct?
Baseball435
Posts: 548
Joined: Sun May 30, 2010 3:49 am

Re: Forsaken sanctum mysql and 000webhost help

Post 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
User avatar
SpiritWebb
Posts: 3107
Joined: Sun Jul 12, 2009 11:25 pm

Re: Forsaken sanctum mysql and 000webhost help

Post 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.
Image

Image
Baseball435
Posts: 548
Joined: Sun May 30, 2010 3:49 am

Re: Forsaken sanctum mysql and 000webhost help

Post by Baseball435 »

Yesss thank you so much spiritwebb. Now it's working
Post Reply

Return to “Advanced Help and Support”