Go Back   HostGator Peer Support Forums > Public Forums > Pre-Sales Questions

Notices

Reply
 
Thread Tools
  #1  
Old 07-14-2008, 07:21 PM
pitospir pitospir is offline
Hatchling Croc
 
Join Date: Jul 2008
Posts: 2
Default MySql question

Hi,
I'm interested in buying a site (baby plan) and I'd like to ask something about mysql.
Having my databases hosted in your servers is it possible to access them remotely from any other pc? I don't mean through cpanel. I mean using an application like "mysql administrator" or even writing an application myself that connects to my databases.

Assuming that DNS will give me the ip, what would be the port for the connection string.

In general, can I to connect my databases remotely?
Reply With Quote
  #2  
Old 07-14-2008, 07:31 PM
GvilleRick's Avatar
GvilleRick GvilleRick is offline
Emperor Croc
 
Join Date: Jan 2007
Location: Greenville, SC
Posts: 2,556
Default Re: MySql question

Yes, it is possible to connect to the database. You would set up a Remote Host IP in cPanel to allow it to connect using the default port of 3306.
Reply With Quote
  #3  
Old 07-14-2008, 11:18 PM
generay generay is offline
Hatchling Croc
 
Join Date: Jul 2008
Posts: 4
Default Re: MySql question

Hello, Im setting up a database. Im stuck getting this error below..cant seen to find anything wrong in my script. I have a feeling Im getting the "localhost" part incorrect..why is that simple step so tricky.

Can I please get some help with this?? thank you
Gene


MySQL said: Documentation
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '<?php

$MySqlHostname = "localhost"' at line 1
Reply With Quote
  #4  
Old 07-14-2008, 11:25 PM
slapshotw's Avatar
slapshotw slapshotw is offline
Veteran Croc
 
Join Date: Jun 2006
Posts: 5,163
Default Re: MySql question

Did you put a semicolon after the line? (Just making sure the simple stuff is covered).

Also, it seems like the "<?php" is being used as part of a query. Can you give us more lines of the file, above and below it?
__________________
Follow me on Twitter! http://twitter.com/mrw
Reply With Quote
  #5  
Old 07-14-2008, 11:45 PM
generay generay is offline
Hatchling Croc
 
Join Date: Jul 2008
Posts: 4
Default Re: MySql question

Hey, I really appreciate you looking at my php. Its posted below and Ive edited the user and pass.
Thanks a heap..

Gene


<?php

$MySqlHostname = "localhost"; //the name of your host - if its local leave it as is.
$MySqlUsername = "txxxx_xxxe"; //the username to your database.
$MySqlPassword = "pxxxxx"; //the password to your database.
$MySqlDatabase = "txxxxx_xxxxxd"; //the name of your database.


// do not edit below this line!!
///////////////////////////////////////////////////////////////////////

$dblink=MYSQL_CONNECT($MySqlHostname, $MySqlUsername, $MySqlPassword) or die("Could not connect to database");
@mysql_select_db("$MySqlDatabase") or die( "Could not select database"); ?>
Reply With Quote
  #6  
Old 07-14-2008, 11:55 PM
slapshotw's Avatar
slapshotw slapshotw is offline
Veteran Croc
 
Join Date: Jun 2006
Posts: 5,163
Default Re: MySql question

Is this file getting called as an include from another file?
__________________
Follow me on Twitter! http://twitter.com/mrw
Reply With Quote
  #7  
Old 07-15-2008, 12:02 AM
generay generay is offline
Hatchling Croc
 
Join Date: Jul 2008
Posts: 4
Default Re: MySql question

Quote:
Originally Posted by slapshotw View Post
Is this file getting called as an include from another file?

Its called connect.php for an advertising exchange script.. Its the file that creates a table. I am at the step where it runs sql so now it calling out a line one error...Ive double checked everything.

Gene
Reply With Quote
  #8  
Old 07-15-2008, 12:06 AM
slapshotw's Avatar
slapshotw slapshotw is offline
Veteran Croc
 
Join Date: Jun 2006
Posts: 5,163
Default Re: MySql question

If you want PM me, I don't want to have all the back and forth here on the thread--let me help you try to fix it and then we'll post the resolution.
__________________
Follow me on Twitter! http://twitter.com/mrw
Reply With Quote
  #9  
Old 07-15-2008, 12:27 AM
generay generay is offline
Hatchling Croc
 
Join Date: Jul 2008
Posts: 4
Default Re: MySql question

Quote:
Originally Posted by slapshotw View Post
If you want PM me, I don't want to have all the back and forth here on the thread--let me help you try to fix it and then we'll post the resolution.
Thanks...
Reply With Quote
  #10  
Old 07-16-2008, 03:36 PM
pitospir pitospir is offline
Hatchling Croc
 
Join Date: Jul 2008
Posts: 2
Default Re: MySql question

Quote:
Originally Posted by GvilleRick View Post
Yes, it is possible to connect to the database. You would set up a Remote Host IP in cPanel to allow it to connect using the default port of 3306.
Thank you for the info!
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
MySQL database Question Joe Pre-Sales Questions 4 09-29-2005 09:12 AM
MySQL & Speed question JeffR Pre-Sales Questions 2 08-27-2005 06:54 PM

All times are GMT -6. The time now is 02:51 AM.

 
Forum SEO by Zoints