Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    MYSQL




Remote Table In A Database


is it possible to create remote virtual tables in mysql? By that I mean
if it is possible to define a table, which actually resides on a remote
mysql server, but which can be accessed and addressed as if the table
would be on the local database.

My intention is to move one table to a remote host, but to be able to
address the table as if it was still on the same machine.

So for example:

SELECT m.header, m.body, m.from, m.to FROM users u, messages m WHERE
u.login=m.login;

would still work, even though the table "users" resides in the database
"moon" on a different host, than the table "message", which resides on
the localhost in the database "alltables".

The problem I'm trying to solve is: I have to webapplications, which
both have a table, which stores login information. Those tables have to
be combined into one and have to be put on one of the hosts only.

One of the application will access the remote user table for logins.
Since many of the SELECTS of this application contain joins like the
example above I'm looking for a way in which I do not have to modify
the selects but can move the login table to a different machine.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
How Can I "see" A Table In A Database On A Remote MySQL Server After Creating It
I used the following SQL to create a new table in a database on
a remote MySQL server by copying one already there. I know the
table exists SOMEWHERE in cyberspace. I can read its data, write
to it, delete from it. But I cannot see it. The only way I know it
exists is by running this SQL from Access 97 pass through query:

SELECT ALL new_tbl.name FROM new_tbl

The database resides on a MySQL server that was created with
a single table (named test) in it for testing purposes. I ran the
following SQL to create another copy of the table in the same
database named: new_tbl

CREATE TABLE new_tbl SELECT * FROM test;

I cannot see the new table in the Access 97 database window
under the Tables Tab. Anybody know how to overcome this?

Its a severe drawback to programming efforts not to KNOW what
tables are in your database.

Connecting To Remote Database
I'm using MAMP on a MacBook Pro. The only database connection I've been able to write that doesn't return an error message is on the database "test" that's installed by default:

$link = mysql_connect ("localhost" , "USERNAME", "") or die(mysql_error());
mysql_select_db ("test", $link) or die(mysql_error());
...where USERNAME is a username I created and accidentally applied to all my databases. Anyway, I assumed I could use the database "test," since I can at least connect to it.

But my queries all display error messages, even after I copy the tables they reference into the database test. Finally, I wrote a very simple query:

$Geog = mysql_fetch_assoc(mysql_query("SELECT * FROM gw_geog_gw"));
But I still get the following error message:

Quote:

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /Users/MyName/Sites/Geobop/Files/World.php on line 7

Does that mean I'm not even connected to the database "test"?



Connecting To A Remote Database....please Help
I'm trying to connect to a remote database, but am not sure how to do that (ie what command I should use in the Terminal). I have a php file that gives me all of the details:
<?
Database Details ----#

$host = "**.**.**.***";
$dbname = "**************";
$dbuser = "**************";
$dbpass = "**************";


Paths Used in Codeing ---#

$root_path = "/home/software/public_html/**************/";
$http_path = "http://www.webaddress.com/**************/";

?>

Triggers To A Remote Database
We make use of a PACS (Picture Archiving and Communication System) and
system to store DICOM (Digital Imaging and Communication in Medicine)
images (like CT scans, MR images etc.) in our Oncology Center. This PACS
system uses mysql as it's native database, in which it stores certain
data as date and time of the examination, it uses InnoDB tables.

We are building another application around it, which will use data from
the PACS tables and will hold additional data in a seperate database in
it's own tables.

Every study has it's own unique identifier which is stored in the PACS
database. Additional data is stored in the additional database, under
the same unique identifier to be able to keep track of the data and link
it to each other.

Now I would like to know if it is possible to add a trigger to the PACS
database which will delete the related information in the additional
database if a record in the PACS database is dropped. This trigger will
have to delete the records in the additional tables before dropping the
data in it's own database, so we can maintain a more compact database
and don't store data which we cannot link to the PACS system anymore.

Remote Database Issue
I am trying to setup Joomla with the following setup.

Web server 192.168.99.80-82 Joomla is specifically at 192.168.99.82
MySQL server 192.168.99.90

I used MySQL Administrator to setup user account which I will call test. Then I right clicked the user and selected Add host from which user can connect. I then typed in 192.168.99.82. I had issues so I also added .80.

I then created a database called Joomla and then gave user test full rights to this database. I also opened port 3306 on software firewall. Then I shut off firewall.

Tried to install Joomla, but I get error when connecting to database.

I loaded MySQL Administrator on web server and I am able to connect to MySQL.

Connecting To Remote Database
I'm passing in the ip address of the server, my userid and password, but I get back my userid appended with my local machine name (or maybe it's the local domain, not sure) and it fails to authenticate? Is there any way to override this appending of domain?

Remote Database Updating
I am working on an internet enabled sensor device project. I have a small microcontroller device that is connected to a sensor device. I want this device to dial the ISP and post its readings each day. I would like to know if anyone might have any suggestions on how this could be done.

Once the unit logs onto the server how might I code it to access the data area and post its reading. Also can this even be done. I mean does the microcontroller have to have a special database driver to access the remote database?

Remote Connection To Database
i have a web-hosted website and i need it to connect to my mysql database is there anyway i could set this up.

Selecting From A Remote Database
I would like to create a stored procedure that could select from a remote database, can i do that with MySQL?

Administrate A Remote Database
How is it possible to administrate a database placed on a remote server, without having access to it's desktop ?When i use the MySql adminstrator program it disables some of the setting, and says it has to bee a localhost connection.I would like to install the dataabase on a server, and afterward just use clients to administrate through.hope someone can explane the setup.

Remote MySQL Database
I have a MySQL Server in a Windows Box. How can I connect to the server
from another windows box using ODBC?

Accessing Remote MySQL Database
Is it possible to access remote MySQL databases?

I manage several sites and I will soon be building a tool that can track all of them, and it would be really convenient if I could somehow access all of the databases from one remote site.

Connect To Remote Database(MySQL)
is there some sort of setting I need to turn on where I can access the database from another server. So instead of using "localhost" I can use the actual server IP address.

And just for future reference, is this how you set up a application server connecting to a database server?

Database Synchronisation On Two Remote Sites
I am considering the possibility of trying to keep a user table synchronised on two different sites. This is not something i've done before so i'm looking for any tips that might help me on my way.

Basically I was thinking of:

- scheduling php script to connect to both databases via cron to update the table at regular intervals
- generating an xml feed and doing the same thing

Both methods would potentially involve storing a pointer to only read and write the new rows, although perhaps I could use DATETIME to also copy accounts that have been updated since last run.

Probably biggest concern is:
- security... operating in a way that the data is private. The most sensitive data is hashed passwords and postal addresses, I don't think it would be appropriate to not somehow protect this info during transfers. I'm not sure whether SSL is an option (should be) but possibly I was thinking of creating some kind of token system.

- bandwidth. both sites should be fine resource wise but due to my lack of experience in these matters I don't really know what the performance hit will be, and I would like to run the script very often

As far as I know alot of big sites (for example hotel booking engines) use xml in the background to share info but I really have no idea how it all works.

Query Database From Remote Location.
I have a database sitting on my db server, which is part of my office network (which has a domain controller). Access to the outside world is via a router, which is well locked down.

Currently, remote users access the database front end via Terminal Services but this is only a method of accessing an application stored and running on the Database Server.
What I want to do is allow access to the database from a server, which is located in another building (another part of the country). This is essentially an inter/intranet server.

What is the best way for me to get this external server to be able to query my database server?

Downloading A Database From Remote Server Using Ssh?
I need to copy a database from a remote server where I have ssh access to my local computer. Can anyone tell me how to do this?

I was thinking something like this:

- login to ssh
$mysql_admin database_name | local_pc (very simplified)

Connect To Database From A Remote Source
I own a website and plan on running multiple message boards on it...the problem is that I would like a database per board...however my host only gives 1 database....unless I want to pay an extaordinary amount of money for more.

So I have used my PC as a webserver before without any problems and in fact ran a pretty big board off it with php, mysql, phpmyadmin installed.

So my thought was to use a couple of databases off my PC to help run the new boards.

I have created the database...but I'm having trouble with the board connecting.

I'm sure that it's some kind of permission that needs to be inserted for the remote host to connect to my databases.

Configuring A Database On A Remote Server
i have an aplication on .net for web, with mysql db, in my local server i have no problems, but recently i upload the aplication into a bougt host; when i open the page on the internet explorer or firefox, the page loads well, except for one simple grid. in another part of the aplication i try to insert a record, the app gave the me no error message, but when i check the table, there's nothing new.

i don't if i configuring something wrone, on the web.config. and the worse of all if that i dont get any error?

VB6 Controls Not Populating From Remote MySQL Database
I have created a VB6 app that connects to a web hosted MySQL database.  I have created the connection string in my app and used the Port number required by the Web Host.  All my data comes back to my VB forms when I run my app from my Win XP development machine, but here is my problem...

I have installed the app using InnoSetup wizard on a Win2K pc at SP4, and it connects successfully to the databases, but my textboxes, labels, comboboxes and datagrids show no data.  For example, one of my forms has textboxes and a datagrid, and a statusbar.  The textboxes and datagrid are bound to ADO controls which pass SQL statements to MySQL to create the recordset.  The statusbar shows the RecordCount from the resulting recordset.  The statusbar shows the correct recordset count, but the textboxes and datagrid are empty.  This doesn't happen on my development machine.

In my installer, I have installed all the VB Runtime files to the target machines WindowsSystem32 directory, and have installed the OCX files the app uses to the application's directory.

I am at a complete loss to know why I can connect to the database, successfully open a recordset but not populate my forms' controls with the resulting data.

Method - Remote Databases To Central Database
I am looking for the best approach to move data from four remote MySQL database applications back to a central MySQL database in near real time. Each remote database has a low number of transactions up to 15 per second of large data sets (12,000 items). The central database will be replicated across two servers for redundancy.

Database Dumps From Remote Server Via Proxy
How to copy a MYSQL database placed on a remote server using 'mysqldump' where there is a proxy server involved? This proxy server requires user name and password. I have Win XP.

Connecting To Remote Database Via MySQL Administrator
I have used Sql Server and other databases extensively. I have the following questions.

1. I need to connect / manage a SQL database located on a remote web server runnin Linux. My workstation is running Windows XP. I understand that this is what MySQL Administrator is for. Is this correct?

2. Can I run both MySQL and SQL Server on my Windows XP machine?

3. What one book would be the most helpful to help me get a basic table setup?

MySQL Slow To Connect To Remote Database
I was running a PHP/MySQL web site with the database on the local web server. I needed to move the database off the webserver (located in the firewall DMZ) and onto its own machine (behind the firewall on our private network)

Now when I run my web site it goes really slow. I ran mysql from the command line on the web server and connected through to the database machine behind the firewall using
webserver:/# mysql -h 192.168.1.7 -u www-data -p

After I enter the password, it takes around 5-7s before I see the mysql> prompt.

Is mysql trying to do reverse dns on the IP address and timing out? I added the machine details to /etc/hosts so it would be recognized but no improvement. Or do I have something wrong with my mysql configuration?

Remote Connection To Mysql Database Using JDBC?
I am trying to set up OpenOffice Base to connect to a remote os x server with mysql on it.

It has the default mySQL JDBC driver class set to com.mysql.jdbc.Driver

It also asks for server URL, should this be the ip address?
Port number? Default is set to 3306.

When I set the class it says that the JDBC driver could not be loaded.

Copy Records From Tables To Remote Database
there ara two mysql server server1 and server2. server1 ip adress is 192.168.1.2 and
server2 ip adress is 192.168.1.3. both servers have same database. i want to copy records server1 to server2 have can i do this?

Connect Remote JSP Files With Local MySQL Database?
I use dreamweaver 8.0.
I have my jsp files on the remote server Z:.
I have my local computer 'A' connected to this server.
I have my MySQL database on my 'A' computer.
I want to know how to connect the remote JSP files with the database?
Currently I am using jdbc.odbc drivers on 'A' computer.
But my server computer has Linux and uses org.gjt.mm.mysql drivers.
Which drivers and Where should be the drivers?

Connect Remote JSP Files With Local MySQL Database?
I use dreamweaver 8.0.
I have my jsp files on the remote server.
I have my local computer connected to this server.
I have my MySQL database on my computer.
I want to know how to connect the remote JSP files with the database?
Where should be the ODBC-drivers?

Forcing Remote Reload Of PHP Page After Database Change
I'm developing a mysql database and have users access the data via homemade PHP pages that query data. When the user(s) open the PHP page or query on it, it fetches the data from the database and then refreshes the page showing the new data.

If something in the database changes, like if a user adjusts some value, is it possible for mySql to send out some sort of "autorefresh" signal/trigger to all open connections to the database, which could be used to automatically refresh the user(s) PHP page, thus giving them the most up to date information without them having to manually click refresh?

How Do I Enable Remote Access To MySQL Database Server
I want to connect to my mysql server which is seperate on an external server but i dont know how to enable remote access to MySQL database. The mysql server is on xp and running mysql 5.

Backup/Restore Mysql Database From Remote Server To Local Pc
Im trying to download mysql database "dbproducts1" which is residing in my webhost's server (Linux). From telnet i backed up using "mysqldump -u -p dbproducts1 > dbproducts1.sql"

Then i downloaded this file via ftp to my local pc(WinXP). Now on my local pc to restore database i went to command prompt and i did following:

mysql -u -p dbproducts1 < dbproducts1.sql

I got following error:

ERROR 1064 (42000) at line 380: 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 '-workshop (
  title varchar(250) NOT NULL default '',
  decription longtext NOT ' at line 1

I opened the phpmyadmin and found that dbproducts1 database was restored but with only few tables i.e. not all tables in the db was restored.

Can somebody please help me to backup/restore this database. I checked the mysql server version and found following:

server version: 5.0.24a-community in my local winxp pc
server version: 3.23.36 in my webhost's server (Linux)

MySQL Remote Backups - No Access To FTP Or Remote Command Line
I have a mySQL database located on a remote host's server. I would
like to schedule a task on my local Windows computer to retrieve a
backup/dump of this remote database.

I have contacted my host, and they indicated that the server is only
open to the Internet via mySQL. Therefore, even if I did have access
to that server's command line (which I don't) to create dumps via
mysqldump, I would not be able to retrieve via FTP.

Does anybody have any ideas as to how I can generate backup files from
my local computer through a local command-line interface? I have done
it through a GUI (DBTools), but I would like to have it done via DOS
batch, so that I can schedule it. Does anyone know of any mysql backup
GUIs with command line switches? Or can somebody recommend an
alternate means of getting a local backup?

Cant Load Text File Into Table From Remote Browser
I'm trying to run:

$sql = "LOAD DATA INFILE 'E:AHLog.txt' REPLACE INTO TABLE `items`
FIELDS TERMINATED BY '' LINES TERMINATED BY ''";
$result = mysql_query($sql);

And I thought that "REPLACE" would take care of repeating rows, but it doesn't. How do I write a mysql command that only inserts UNIQUE rows, and not repeat rows?

Extracting Data From Large SINGLE-table Database To MULT-table Relational Database
I have a very large single-table database of articles that I want to convert to a multi-table, relational database.

The existing single-table database contains fields for article author, article source, and article category, where several 'author', 'source', and 'category' IDs repeat dozens of times for hundreds of different articles.

I want to create seperate tables for author, source, and category and populate the new tables by extracting data from the original single-table database by unique ID field.

I figured out how to use INSERT and SELECT to pull data in new tables, but can't figure out how to pull only a single instance of a unique author, source, and category to create master reference tables for author/source/category.

Move Table From A Database To Another Table In A Database
I am currently developing a project as I am only a web designer.

I need to move a table from a database to another table in a database.

I am using SQL Server 2005 Express. How is this done?

I have been stuck for months trying to figure this out!

I have even bought SQL Server Express 2005 for Dummies and cannot figure this out!

I need someone to hold my hand and walk me through this literally! Or give me syntax code to do this.

Renaming Table In Database, Restoring Data To Table
A consultant recently hired at my company overlayed/wiped- out a table in a database I created for him. This database was a copy of a live database so I have the original table data he deleted.

How do I rename the product table he created to os-product, it must live in the same database?

How do I create a the product table and import the original data from the live database?

Inserting Data From One Table To Another Table In Same Database
I have got about 80 tables (same structure/fields) from my client. I want data of all 80 tables in one single table. There are around 90 lakhs records in 80 tables. How do I get to do this ?

Reference A Table To Another Table On A Different Database
i have two apps (app1 and app2) which each use a different database (db1 and db2), all of which resides on the same server.

each app utilizes the same login credentials (i.e. one would log into app1 with the same info used to log in to app2).

so, what i would like to do, instead of having two separate userinfo tables on each database, is to have one userinfo table which would hold all usernames and passwords on db3 and then have a table on each of db1 and db2 referencing the db3 table.

does this make sense? and is it possible? i am just trying to avoid having multiple tables to update whenever any user info is changed. if you need me to explain any more let me know.

Database, One Table Or Several?
Lets say we want to record some statistics of a site.

We want to record hits for things such as articles, article categories, article authors, and the article level (if a membership or something).

We could have.

Table _statistics

Columns:
id
ip_address
datetime
article_id
category_id
author_id
level_id

So if they visit a category we add a record with a category ID, but article is NULL since they didnt visit an article. But if they visit an article article ID would be filled but not category ID.

So in a way we are tracking multiple statistics in different places on the site in one table. Is this fine to do? Or would we want different tables like...

Table: _statistics_categories
id
ip_address
datetime
categoryid

Table: _statistics_articles
id
ip_address
datetime
articleid

... and so on.

This seems like it would get to be a lot of tables for each individual statistic we wanted to track.

Add Database Or Add A Table?
I have a database where a table is getting a lot fuller than I expected.. it's a "contact Log" table that teachers are using and it is getting huge. It's not slowing things down yet, but the majority of users haven't even been allowed in to the database yet so I am trying to prevent any slowdowns.

Question: Would it be advantageous to move this table to a separate database all its own?

The database currently resides on a dedicated Linuz server. I am running Mysql 5.0/php.

Database And Table Max
If in a perfect world, and my host allowed me to have as many databases as possible, how many will MySQL let me have?

How many tables will MySQL let me have in a table?

How Many Table Should Be At 1 Database
How many table that we could make at 1 database?

What is the best condition:
make many table only at 1 database, or
make some table at some database.
(both of them have the same total table).

Database Table Row
I have a very strange case where one entire row's set of fields
literally "shuffled"... e.g., "phone" became "email", "email" became
"address2", "address2" became "url", "url" became "resume", etc.
It has never occurred before or since, only 1 record was affected.
There was no outside interference and the data was apparently never
touched by anyone (according to external and MySQL logs)
MySQL 4.0.17 DB within Linux Red Hat Enterprise Level 4

Database Table Structure Help
I am not sure how I need to design the following tables. If someone would provide me with a little bit of guidance I would appreciate it.

Here is how I see it now:

Host
-id
-name

Guest
-id
-host_id(which is just the id from the host table)
-name
-email

Sizes
-id
-guest_id(which is just the id from guest table)
-sex
-small
-med
-large
-xlarge
-xxlarge
-requests

I believe with the above structure I could have a user select a host, fill in their name, email and sizes and submit. Then using an insert (or update, as needed) statement I would insert the host_id, name and email in the guests table and a second insert would insert the size information.

I think it looks right but I am not sure,


Database Design: Keep One Table Or Add More?
This is perhaps due to bad planning but regardless its now an issue.

I plan to have different sections on my site, each with a general article feel but displayed differently and whatnot.

I decided using a simple `article` table with things such as title, short description, body, author, and so on.

The problem is now I realize each section might need a bit more data than other sections.

The question is: Do I make these seperate tables or just add fields onto my existing article table to handle these edge cases.

There are a few issues with seperate tables. One being my comment system will no longer work since it assumes everything is an article.

Using one table with extra fields would solve this problem but then some of the columns will be null for each row.

I don't think that is such a bad thing, especially since I'm not going to have too many rows in the first place.

What do you guys suggest? I'm leaning towards adding more columsn to my existing database.

Copy Table To A New Database
really need ur help guys on how to form a php code to transfer data from 1 table to another table which is the summary of the original table. For example, i have a table, named mobal and the structures of the table are as below:

mysql> desc mobal;
+--------------+---------------------------+------+-----+---------------------+-------+
| Field | Type | Null | Key | Default | Extra |
+--------------+---------------------------+------+-----+---------------------+-------+
| RecordID | int(10) unsigned | | | 0 | |
| DateInsert | datetime | | | 0000-00-00 00:00:00 | |
| DateSend | datetime | | MUL | 0000-00-00 00:00:00 | |
| MobileNumber | varchar(11) | | | | |
| MONumber | varchar(20) | | | | |
| Message | varchar(225) | | | | |
| Status | enum('Success','Failure') | YES | | NULL | |
+--------------+---------------------------+------+-----+---------------------+-------+

in this mobal table, there are millions of data and i want it to be summarized in the new table by transfering only the amount of data on any particular date. The structure of new summarized table is:

mysql> desc mobalsum;
+-------------+----------+------+-----+---------------------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------------+----------+------+-----+---------------------+-------+
| NewDateSend | date | | | 0000-00-00 | |
| TotalSum | int(10) | | | 0 | |
+-------------+----------+------+-----+---------------------+-------+

and then, my application will be using this new summarized table which is mobalsum for querying purpose.the reason of im doing this is because, im just thinking this way in order to speed up the query as an alternative since the use of index still cause my application very much slow when retrieving millions of data.

Copy Table To Another Database
I have two tables and I'd like to copy some contents of table 1 to a specific field table 2. Their (the tables) purposes are the same, but the structure is different. There are some fields present only in table 1 and others only in table 2.

Is this possible?

How Could I Move A Table From One Database To Another?
I have a *damaged* MyISAM stock_take_mst.frm in /var/lib/mysql/abc.
And I would like to move it to /var/lib/mysql/test and experiment with it.

Is there a MySQL command to detach and attach a table?

Database Table Limits?
I'm having some trouble with accessing or altering my tables in database and I was wondering if this was due limitations in table size. I created a few tables with about

4000 rows
at least 3 columns

When I attempt a SELECT *
and use PHP to print out the Table, the browser just gets stuck loading the data.
Also, any attempt to CHANGE field names gives me the same result. I tried

ALTER TABLE tableName CHANGE oldname newName INTEGER

and the browser also gets stuck loading the page.

Are these tables simply too large to handle? what's wrong?

Copy Table From One Database To Another
i have two databases in mysql server, How i can copy one table from one database to the other one?


Copyright © 2005-08 www.BigResource.com, All rights reserved