473,396 Members | 2,009 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to connect to mysql online database

Greetings,


I'm having this error , Can't connect to MySQL server on '_______' (10061)

I have a lot of questions running in my head right now,

first is, the '___' on top, should it be an ip of the server?
also, should i have my php and html file uploaded?

What i'm actually trying to do is do an insert command to my mysql database, I don't have my html file and php file uploaded, i'm just running them on my desktop or local drive.

How can i make this work?

If it's any help, the address bar is (http://localhost/gwg/insert.php) which is where the php file and html file is located.

Do i need to have my locally installed xampp running?

If you need any clarifications please reply to this post.
Sep 10 '09 #1
5 8993
dlite922
1,584 Expert 1GB
Okay, wow, where do I begin.

Yes. Xamp must be running.

"localhost" is an acronym for "this computer". So if we type that into our browser, it would try to find the folder gwg with file 'insert.php' on our computer, which of course does not exist (even if we did have xamp running)

I don't know why your getting those lines for the mysql host, but if mysql is located on your computer, you should put something like 'localhost', '127.0.0.1' or the IP address of your machine.

Since all of this is local, the files don't need to be 'uploaded' anywhere, they just needed to be in the folder that Apache is xamp is serving. (I've never used, never will use xamp, so don't ask me)

If you have PHP running and you're having trouble with the code, post the code here so we can help you fix it.




Dan
Sep 10 '09 #2
Here you go.

Expand|Select|Wrap|Line Numbers
  1. <?php
  2. $con = mysql_connect("82.197.130.38","319770_gwonder","*****");
  3. if (!$con)
  4.   {
  5.   die('Could not connect: ' . mysql_error());
  6.   }
  7.  
  8. mysql_select_db("319770_gwonder", $con);
  9.  
  10. $sql="INSERT INTO reg_Userdb (user_Fname, user_Lname, user_Age, user_Etc)
  11. VALUES
  12. ('$_POST[fname]','$_POST[lname]','$_POST[age]','$_POST[ea]')";
  13.  
  14. if (!mysql_query($sql,$con))
  15.   {
  16.   die('Error: ' . mysql_error());
  17.   }
  18. echo "1 record added";
  19.  
  20. mysql_close($con)
  21. ?>
I'm using a free mysql hosting service, the site is... well... i'll just give you a pm if you need the site's address. I'm pretty sure i have the right password and username. I can't find any forum or community for the site where i can ask for some guidance.

@dlite922: Thanks for the response. Hope we can solve this together with your help.
Sep 11 '09 #3
Dormilich
8,658 Expert Mod 8TB
does your mysql server allow remote access?
Sep 11 '09 #4
I'm using host-ed.net.

I'm not really sure checking on the "overview" for the free sign up right now. Also, i consulted someone from my school to try another free mysql hosting site just in case the one that's causing the problem is the host itself. I'll try to give you an update a little bit later.

Note:

Don't consider the site i listed above to be an advertisement, just wanted to know if somebody else is using that host.

@Moderators:

You can delete it if you want.
Sep 11 '09 #5
Got it. I just had to upload my files to the server itself where my mysql is sitting. Thanks for all those who replied.

Just to give a heads up, i might posting other questions in the near future. :p

I just love bytes.
Sep 11 '09 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

20
by: Mr Dygi | last post by:
Hi, PHP 4.3.4 installed manually from package *.zip and Apache 2. I have a problem with this simple code: <?php $link = mysql_connect("127.0.0.1","","") or die("Could not connect: " ....
1
by: Jordy | last post by:
Environment: Sun servers running solaris 2.8 Php 4.3.6 Apache 1.3.29 Mysql 4.1.1 phpMyAdmin 2.6.0-alpha1 phpAds 2.0 PhpMyadmin and phpAds don't succeed to connect the MySql database when
7
by: atlasyeo | last post by:
Hi, my first time posting on a newsgroup. anyway, let's cut to the chase. I'm trying to migrate mysql database form one server to another server. So I copied the data from /var/lib/mysql to the...
0
by: praba kar | last post by:
Dear All, I am doing Python-cgi Project in my company. To connect My sql database(Mysql 4.1.11.) into Python(2.3.3) cgi. I have installed MySQL-python-1.2.0. After installation of...
6
by: Jeff Sandler | last post by:
I have a database I created in mySQL. I've been entering data every day into the database using a Java application that I wrote. The database and the Java program are on the same Win 98 SE...
1
by: ikrabbe | last post by:
Hi, I want to set up a mysql server in an embedded process. I managed to start the server in my program as described through mysql_server_init() Now I need a client connection to this...
2
by: Martin | last post by:
Hi all. I have a fully functional page hosted on my PC that uses PHP and connects to MySQL on my PC to generate it's code. I now have some web hosting available which includes both PHP and...
1
by: JustMe | last post by:
Hi all, Although I've got quite a lot of experience with php and (M/My)SQL, I only used both within an online php script. These last few months I bought an option with my webhost to access...
4
tolkienarda
by: tolkienarda | last post by:
Hi all I work for a small webdesign company and we have remote hosting. i built a mysql database with phpmyadmin on the server. i then downloaded and modified a php login page. i am continuing to...
1
by: jmohan | last post by:
Dear Sir/Madam, I develop a website in asp.net with c#. And also, I develop a toolbar in the toolbar studio separately. Aim of the Website: Enabling the visitors to become a member of our...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.