Welcome! Log In Create A New Profile

Advanced

connecting to database from free web hosting area

Posted by FinalOracle 
Announcements Last Post
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
connecting to database from free web hosting area
October 03, 2012 01:56PM
could anyone please clarify this massage from free hosting area?

mySQL HostName is localhost only. We don't allow external connections.

// I tried the loopback (127.0.0.1) for $Hostname in my connect.php page, it gave me this error massage when i try to log-in to my site:

“Query failed: Access denied for user 'apache'@'localhost' (using password: NO)”;

Bye

from Boitumelo S
avatar
Mac
Re: connecting to database from free web hosting area
October 04, 2012 08:57AM
Did you use localhost as the server name?
Re: connecting to database from free web hosting area
October 09, 2012 09:47PM
Hi

Please help i am also getting the same error.

Warning: mysql_connect() [function.mysql-connect]: Access denied for user '******'@'localhost' (using password: YES

used localhost as my server name. My username and password is correct.
avatar
Mac
Re: connecting to database from free web hosting area
October 10, 2012 09:05AM
The error says the password is YES (actually meaning no password was entered) so it cannot be correct..
Re: connecting to database from free web hosting area
October 10, 2012 10:22PM
Hi Mac

Thanks for the help, but i have checked my password on the script against the password used to login to the database. it is 100% the same.
Unless if im using the wrong user name (which is the username to the the database) ? Please help

$connect = mysql_connect('localhost', '********', "*******"winking smiley
or die ("Could not connect to the server"winking smiley;

still the same error
Access denied for user '********'@'localhost' (using password: YES)
avatar
Mac
Re: connecting to database from free web hosting area
October 11, 2012 07:49AM
Use formatted code button to post code....!!!!!!!!!!!!!!!!!

The registration information they have sent you says it all. Read it carefully. I cannot help further sad smiley
avatar Re: connecting to database from free web hosting area
October 12, 2012 10:23PM
You need to set a user on the DB to use.
Go to phpMyAdmin, click on your database, then privileges in the tabs at the top.

Choose the host as "local" and add a username and password, check all the checkboxes at the bottom, click on "GO" and presto, you have a username and password to use.
Re: connecting to database from free web hosting area
October 25, 2012 09:22AM
Hi

I have tried to follow the directions Metalaniac has provided, but I am still getting an error like this "Sorry! Database not found: Access denied for user 'Dumisani'@'localhost' (using password: NO)". I suppose I am not getting the meaning of presto or I cannot see such, can you help me please.
Below is how my connection code looks like at the setting.
Language: PHP
$user_name = "Dumisani"; $password = ""; $database = "informationemployees"; $server = "localhost";
Re: connecting to database from free web hosting area
October 25, 2012 10:24AM
If you used 'freewebhostigarea':

the server is localhost;
the db username will be given to you, some number;
the password is the password you use to log on to 6te.net, the remote server
Re: connecting to database from free web hosting area
October 25, 2012 11:26AM
Hi

Thanks. You mean the details I was provided by freewebhosting area to log in? Do password and username need to be the same on database and on my connection code, and are these details used there in both?
avatar
Mac
Re: connecting to database from free web hosting area
October 25, 2012 03:31PM
When you created a database on FWHA, you receive user details for that db.
Re: connecting to database from free web hosting area
October 25, 2012 04:34PM
Thank Mac, but how I ensure that the current database created on FWHA has the database I have on my local computer. I tried to import it but this is the error I am receiving " MySQL said: Documentation
#1044 - Access denied for user '558815'@'localhost' to database 'informationemployees'". The username and password are the same from my php code and my database and these are the information given from Account Manager after creating DB.

Please help.
Re: connecting to database from free web hosting area
October 25, 2012 09:48PM
Just to add, this is now my connection details
Language: PHP
//Open connection to Database $user_name = "558815"; $password = "dumiweza2"; $database = "558815"; $server = "localhost";

The error is still the same "Sorry! Database not found: Access denied for user '558815'@'localhost' to database 'informationemployees'"
Re: connecting to database from free web hosting area
October 26, 2012 06:00AM
Hello!

Good people I know you can help me, how can I loose the battle after so much effort! Please help me, there must be a trick somewhere.
avatar
Mac
Re: connecting to database from free web hosting area
October 26, 2012 07:44AM
The error message says it is informationemployees, which does not appear to be correct, as FWHA creates the db and gives it a name. Your connection details says the db is 558815 yet the error message says the user 558815.
Re: connecting to database from free web hosting area
October 26, 2012 09:30AM
Hi Dumi,

I can see you like using variables but try this bit of code for connect.
Jus make sure its the correct username, password and DB name.

Language: PHP
<?php //Connecting to Server & Database $connect = mysql_connect("localhost", "558815", "dumiweza2") or die ("Couldn';t connect to MySQL Server");   $db = mysql_select_db ("558815" , $connect) or die (';Could not connect: '; . mysql_error()); ?>

Hope this will help you.
Re: connecting to database from free web hosting area
October 26, 2012 09:38AM
O almost 4got,

On FWHA you cannot create or import a DB with your own name you must use their DB, you can only import or create TABLES in their DB with your name of choice.

Also notice that in my above, at the $connect statement 558815 should be same as your username for DB manage.
& at $db statement 558815 is the DB name as they supply.

Let us know if you got right.
Re: connecting to database from free web hosting area
October 26, 2012 03:19PM
Thanks, but the error message still have the old database 'informationemployees' and I want to delete it but I don't know how can anyone help? If I can delete it will recreate it and change the connection code and try again.
avatar
Mac
Re: connecting to database from free web hosting area
October 26, 2012 03:36PM
Use the management interface on FWHA. It is all there.
Re: connecting to database from free web hosting area
October 26, 2012 04:48PM
Thanks Mac, if you meant for deleting the database, I have deleted it but it still reads the old one. I am thinking of creating a new database that will have a new name on FWHA if that's possible otherwise may I have another alternative. Or should I create another on my local PC?
Re: connecting to database from free web hosting area
October 27, 2012 08:57AM
Ja u can del the db & recreate it but it wil give u same name 558815 if that is the 1 they gave u please make sure.

The code i gave u on top should be your ENTIRE connect page nothing else, & on your other pages at the top you should only have the following to connect to DB:
Language: PHP
<?php include ("connect.php"); ?>

Then in your query statement you just refer to a TABLE name.

Also try & clean your browsers cache.
Are all your pages not connecting to DB in FWHA?
Re: connecting to database from free web hosting area
October 27, 2012 12:49PM
Hi

all other pages have only the include statement including the connection page, the two lines are the other lines included in the connection code
Language: PHP
$db_handle = mysql_connect("localhost", "558815", "dumiweza2"); $db_found = mysql_select_db("558815", $db_handle);   if ($db_found) { } else { die("Sorry! Database not found: ". mysql_error()); } ?>
The main problem is that it is still picking the old database "informationemployees" even if the database has been deleted and recreated in both my local PC and FWHA. I have even created a new database and new tables on my local PC to try to get it reading new database, all pages also changed to refer to new tables, but still it still call the old database and printing same error message. How to sort this out, I mean how can I get it to read the database I want it to read?confused smiley
Re: connecting to database from free web hosting area
October 28, 2012 08:43AM
Hi

I have now created the second database and changed connection code to redirect to the second database, my challenge is that the URL pointing to my website is not showing my files but a new txt file that says "TO_DISABLE_INDEXES_DELETE_htfreewha" yet all my php files and codes are there to the ftp site. Can you help please?
Re: connecting to database from free web hosting area
October 28, 2012 01:00PM
Hi Dumi,

It seems in your other pages when querying you might still be refering to that old DB, make sure you are just refering to a TABLE name.
Your new problem I don't have a clue... Sorry.

I'm by no means an expert but I'll stay checking in online today since this last day to try n help you,

The problem doesn't seem to be with your connect page but in other pages when calling on queries.
I would say stick with 1st DB it was closer to correct than 2nd DB...

Was everything working fine on your PC b4 going over to FWHA?
If it was then you only needed to create DB in FWHA then create/import TABLES in that DB, as you named them on your PC with same fields.
Then only edit your connect page codes DB name,username & password as they supplied

Hope this helps... Keep posting
Re: connecting to database from free web hosting area
October 28, 2012 05:08PM
Hi Dumi,

Hope your silence is due to u getting right.

Will check in again l8r.
Re: connecting to database from free web hosting area
October 28, 2012 09:01PM
Thanks bru

I was on the road in fact from 12h00 to 20h00. Everything was working fine on my PC, and posting it to FWHA was successful (I could see all the pages listed after clicking the link)only not connecting. After I was helped on how to refer on the database and how to import, I was then unable to reverse the mistake I did of importing the actual database not tables that is why it kept referring to the old one. The new one is challenging me in the sense that pages are not listed but I am asked to disable index.

If it is ok with you, I am not going to work tomorrow so you can keep checking me online or I can even call you for help. Thanks
Re: connecting to database from free web hosting area
October 29, 2012 08:14AM
Hi Dumi,

If all your pages where working on your PC why not save the ones u got on FWHA then delete them...
Reload all your pages from your PC back to FWHA then just create their DB, note the DB name and manage username & password,
Import or recreate the TABLES as they where named on your PC with same fields.

Then just change your connect page code as you had last.

I'm also at home 2day,

Busy studying 4 VB.NET & Object-Oriented Analysis.
OOA is a SUB in the exam it felt i passed so good, but got 46% for it, don't know where i lost my marks.

So I'll check in at times.

Hope u can get it today.
Re: connecting to database from free web hosting area
October 29, 2012 09:06AM
Thanks. The files are there on the FWHA I can see them, but the problem is when I click the link it is blocked. I now believe its not about coding but technical issue, because when I goggle for help it says when ISP notice temporal visitor or changes (like I did changes creating second database), it issues 403.html file to block access. Then to unblock I need to upload the valid indexes of which I don't know where to find and how to upload then. I logged in to account manager to disable indexes which is done in auto installer, but this is the message I got "Autoinstaller was temporary disabled until we update the scripts to latest versions."

Mac can you help me please on this.
Re: connecting to database from free web hosting area
October 29, 2012 09:22AM
Hi Dumi,
I would suggest u quickly create another account at FWHA, start with clean slate rather to fix broken @ last moments.

Then you can confidantly try my previous suggestion, just create DB import or create same TABLES and edit connect page code.

It should work, when all my pages where working on my PC thats what I did, becasuse of creating & delting mok data in the TABLES of my PC i opted to recreate the TABLES on FWHA, i did not import them.

Try it, if on a new account it still refers to old DB then it must be in your other pages codes...
Re: connecting to database from free web hosting area
October 30, 2012 09:13AM
Hi Dumi,

Waz up? u real quit...

Did you get something right? As u can notice from 1 other post Mac might still accept l8 entries but it must be soon, he will subtract for l8nes.

Holding thumbs 4 u.
avatar
Mac
Re: connecting to database from free web hosting area
October 30, 2012 09:32AM
38701162 - Dumi Wrote:
-------------------------------------------------------
> Thanks. The files are there on the FWHA I can see
> them, but the problem is when I click the link it
> is blocked. I now believe its not about coding but
> technical issue, because when I goggle for help it
> says when ISP notice temporal visitor or changes
> (like I did changes creating second database), it
> issues 403.html file to block access. Then to
> unblock I need to upload the valid indexes of
> which I don't know where to find and how to upload
> then. I logged in to account manager to disable
> indexes which is done in auto installer, but this
> is the message I got "Autoinstaller was temporary
> disabled until we update the scripts to latest
> versions."
>
> Mac can you help me please on this.

I don't know what you are up to and how FWHA manages errors - last suggestion is (was) best.
Re: connecting to database from free web hosting area
November 01, 2012 07:42PM
Hi everyone

I will like to thank everyone who tried to help me in anyway, thank you so much. I finally got right its on the web and can open, I was making a silly mistake in the link itself using @6te.net instead of @freeoda.net. Changing link got me strait to the account. I must say though that is semester was the hardest of them all in my history of studying, I couldn't make it without you. Now ICT 2611 oooohhh

Thanks
Re: connecting to database from free web hosting area
December 18, 2012 09:37AM
Sorry, only registered users may post in this forum.

Click here to login