473,473 Members | 1,867 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

mysql: localhost

Hi. Whenever I connect to a mysql database, I always connect to 'localhost'.
Does that mean that you can connect to a database on another host? If you
can, does that mean that I could use the same database for both of my
websites (which are hosted with different people)? And if you can, how
please? I assume that I would have to create another mysql user, but how
would I connect to the database?

Thanks. Richard.
Jul 17 '05 #1
6 2335
Rich wrote:
Hi. Whenever I connect to a mysql database, I always connect to
'localhost'. Does that mean that you can connect to a database on
another host? If you can, does that mean that I could use the same
database for both of my websites (which are hosted with different
people)? And if you can, how please? I assume that I would have to
create another mysql user, but how would I connect to the database?

Thanks. Richard.


Richard,

You can, assuming the mysql database daemon is configured to allow remote
connections, and no firewall rules are preventing such a thing.

You will need to grant access to the databases for this host, assuming this
isn't already available. For example:

grant all on mydatabase.* to re********@192.168.1.1 identified by
somepassword;

You can now specify the ip address of this database server as the host for
any database applications.
Nathan
Jul 17 '05 #2
In article <ca**********@newsg3.svr.pol.co.uk>, Rich wrote:
Hi. Whenever I connect to a mysql database, I always connect to 'localhost'.
Does that mean that you can connect to a database on another host? If you
can, does that mean that I could use the same database for both of my
websites (which are hosted with different people)? And if you can, how
please? I assume that I would have to create another mysql user, but how
would I connect to the database?


If MySQL server is configured to use TCP/IP sockets it is possible.
But be aware that everything will be sent as plain-text. Most of the
times this is not wanted. A workaround would be to create a tunnel over
SSL to the server, and then connect to localhost:port of tunnel.

--
Tim Van Wassenhove <http://home.mysth.be/~timvw>
Jul 17 '05 #3
Cool. Thanks.

"Rich" <we*****************@apolloesu.co.uk> wrote in message
news:ca**********@newsg3.svr.pol.co.uk...
Hi. Whenever I connect to a mysql database, I always connect to 'localhost'. Does that mean that you can connect to a database on another host? If you
can, does that mean that I could use the same database for both of my
websites (which are hosted with different people)? And if you can, how
please? I assume that I would have to create another mysql user, but how
would I connect to the database?

Thanks. Richard.

Jul 17 '05 #4
On Sun, 13 Jun 2004 13:12:31 +0100, "Rich"
<we*****************@apolloesu.co.uk> wrote:
Hi. Whenever I connect to a mysql database, I always connect to 'localhost'.
Does that mean that you can connect to a database on another host? If you
can, does that mean that I could use the same database for both of my
websites (which are hosted with different people)? And if you can, how
please? I assume that I would have to create another mysql user, but how
would I connect to the database?


Replace localhost with the FQDN. Like yourserver.domain.com

Simple.
Jul 17 '05 #5
"Rich" <we*****************@apolloesu.co.uk> wrote in message
news:ca**********@newsg3.svr.pol.co.uk...
Hi. Whenever I connect to a mysql database, I always connect to 'localhost'. Does that mean that you can connect to a database on another host? If you
can, does that mean that I could use the same database for both of my
websites (which are hosted with different people)? And if you can, how
please? I assume that I would have to create another mysql user, but how
would I connect to the database?


It's possible, but most likely the port used by MySQL is blocked by your
ISP's firewall.
Jul 17 '05 #6
Tim Van Wassenhove <eu**@pi.be> wrote in
news:2j************@uni-berlin.de:
In article <ca**********@newsg3.svr.pol.co.uk>, Rich wrote:
Hi. Whenever I connect to a mysql database, I always connect to
'localhost'. Does that mean that you can connect to a database on
another host? If you can, does that mean that I could use the same
database for both of my websites (which are hosted with different
people)? And if you can, how please? I assume that I would have to
create another mysql user, but how would I connect to the database?


If MySQL server is configured to use TCP/IP sockets it is possible.
But be aware that everything will be sent as plain-text. Most of the
times this is not wanted. A workaround would be to create a tunnel
over SSL to the server, and then connect to localhost:port of tunnel.


It would probably be worth the effort to just move one of your sites and
put them both on the same server. Then you can easily use the same database
and bypass the possible pesky technical issues.
Jul 17 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Petre Agenbag | last post by:
Hi List Been trying to help out with this problem on a SunOS5.8 box running 3.23.56 It experiences periodic lockups of mysql. It does not seem that this server has a my.cnf file for mysql,...
0
by: craig | last post by:
RH 9. # ./bin/safe_mysqld & 15246 # Starting mysqld daemon with databases from /usr/local/mysql/data 030929 19:42:54 mysqld ended this is what I just installed # rpm -iv...
0
by: Mike Chirico | last post by:
Interesting Things to Know about MySQL Mike Chirico (mchirico@users.sourceforge.net) Copyright (GPU Free Documentation License) 2004 Last Updated: Mon Jun 7 10:37:28 EDT 2004 The latest...
4
by: Adam Smith | last post by:
I have a dedicated server running 'FreeBSD 4.9 STABLE' at a hosting site. They have done some default installations, presumably from the CVS ports package ??. Herein lies the problem, "I do not...
2
by: Saqib Ali | last post by:
I installed mySQL and have it running.... but I think I made a mistake somewhere along the line...... I believe I did follow the instructions that were provided with the distribution at:...
1
by: Maxim. V. | last post by:
Hello to everone, As mentioned in this *guide(1), i've compiled mysql on my fedora Core 2 system, with the following spec's : *(1) http://hulan.info/blog/index.php?itemid=576 ...
5
by: MLH | last post by:
I'm supposed to set a password for the MySQL root user. The output of mysql_install_db instructed me to run the following commands... /usr/bin/mysqladmin -u root -h appserver password mynwewpasswd...
1
by: jlee | last post by:
I'm pretty much a newbie on mysql, and I need some help. I am running mysql Ver 12.22 Distrib 4.0.24, for portbld-freebsd5.4 (i386) on a server hosting an active website. The site's developer...
5
by: news.telia.net | last post by:
Hi! I have a question. I have installed php and mysql on an apache-server on windows and I can't connect to the server. I tried to create a database (since I am trying to learn howto). My...
1
by: marcfischman | last post by:
Please help. I have a website running on a linux/apache/mysql/php server. I receive about 8,000-10,000 visitors a day with about 200,000 to 300,000 page views. The server is a RedHat Linux...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.