Mysql, changing file location to remote in local network - mysql

I have 4 computers and 1 server in my local network, there is Xampp(with Mysql) installed on each computer, what I'd like to do, is to cofigure it the way that all mysql data from all computers be saved on the server, so each computer will be talking to the server

you could install mysql on the server, and point all php development to access database on the server. instead of local host.
this should be as easy as changing the database configuration part of your php
just be sure to create user for remote access in the mysql server.
if each computer client have already data in their local database, then dump all databases and recreate on the server.

Related

Replicate local DB to remote server

I'd like to use my local/dev database backup to make a duplicated in a remote server for testing. I have found some commands to do it from remote server to local, what is the way to do it from local to remote server?

How exactly am I accessing the host/server through localhost on phpMyAdmin?

I am working on a school project in which I have to upload data onto a database hosted on phpMyAdmin.
What's confusing me right now is that I see "localhost" at the top of the page and before I even query the database I see "Run SQL query/queries on server "localhost":"
Does this mean that I'm hosting a server on my computer and accessing the database through that? Because then I query for "SHOW VARIABLES WHERE Variable_name = 'hostname';" and it returns with hostname = webhost330. (It is hosted on webhost330.asu.edu).
I'm extremely confused about what this means. Thanks for any possible help.
I'm very new to databases so forgive me if I'm missing something simple here.
EDIT: To clarify: I'm not at school, I'm at my house. What kind of implications does this have? In other words, what's the difference between this and hosting a database locally?
When I host a database on my computer through the MySQL command line client, I can create database information and it's stored on my computer in files. Does this mean that it's initially stored on localhost and then that data is used to create files on my computer?
And then the equivalent of that for the webhost330 is that the localhost stores the database initially but then uploads it to the host at phpMyAdmin? That is the primary thing I'm confused about.
This exactly means what you assumed. When connected to localhost, you are connected to local MySQL server on same machine. Using webhost330.... you are connected to that remote MySQL server instance, if that is not the name of your own machine. Your own server can be webhost30.etcetc.
Edit
If your website is hosted here: webhost330.asu.edu then MySQL host either being webhost330.asu.edu or localhost both mean the same local MySQL server on your very machine.
Edit based on your update
If you are at home, then localhost means you are connected to a MySQL server that you have installed on your own computer. and webhost30.etc.etc means you are connected to the database you have at your school. Database do allow remote connectivity and if you are connected to school from home, that's a remote MySQL connection.
To remove your confusion, you should use only localhost in your code. localhost at home will mean the development server which is your home computer, and when you take the same code to webhost30.etc.etc then localhost for that server will mean its own MySQL installation. So localhost will work everywhere as long as you don't want your code to connect to a remote external MySQL database server.
Assuming you're at school, and assuming you're on your school network. Then yes, your machine is probably "webhost330.asu.edu". At the very least webhost330.asu.edu thinks "webhost330.asu.edu" is localhost.
To see what "localhost" refers to in terms of MySQL server, you have to look at the URL you are using to connect to the web server.
For example, if the URL is
http://localhost/phpmyadmin
and this instance of phpMyAdmin tells me that the MySQL server is on localhost, this means that the MySQL server is on my local workstation.
If the URL is http://example.com/phpmyadmin, then localhost will mean that the MySQL server is on the same machine (example.com).

Sync Local Microsoft MySQL database to remote mysql database scheduled daily

Hi i have a local mysql database that gets updated locally daily on windows machine. at the end of the day, i want a scheduled job to be called by windows that updates a remote mysql database with all the the new data ie compare and synchronize.
i have already created the test database on remote server and ive allowed remote access. i want simple program/solution that i could call on command line that updates remote database with new or changed records etc.
the local database is on a windows machine and remote database is on a webserver with debian.
MySQL allows replication: you wouldnt need to use a specific app, have you looked at http://dev.mysql.com/doc/refman/5.0/en/replication-howto.html

Replication server setup for mysql using phpmyadmin Cpanel

I am hosting my website on a shared server, with a mysql database which I can access it using phpmyadmin only. Can we setup replication mechanism to replicate my DB to my local server periodically?
something like periodically it should dump the data from my live server to my local server or atleast create a dump file.
Thanks,
You can use this URL: http://username:password#website:2082/getsqlbackup/website…database.gz to get a gzipped copy of your databse. username and password are as they say, and 2082 is whatever port you use.
You can use wget in a batch file to get it automatically.

Securely connect MS Access database front-end to MySQL back-end on web host?

We have a fairly simple M$ Access db, split into front-end (forms, reports, etc.) and back-end (tables). Currently looking for a way to get the tables with all the critical data off of one desktop and hopefully into a MySQL database on our web host, and be able to connect to it from multiple PCs (still probably only one or two people connecting to it at any give time), and eventually, hopefully, migrate to a web application when time allows. Many of the examples I've read about people connecting an Access db front-end to a MySQL back-end seem to imply that they are doing so on a LAN, probably behind a firewall, etc.
Is it at all safe to connect a M$ Access front-end to a MySQL backend when that mysql server is running on a remote web host? Does the ODBC connector take care of encryption?
TIA,
Monte
You could use putty to mount a ssh tunnel to your mysql server and redirect the remote mysql port to your machine.
Using putty is pretty straightforward:
Give it your mysql server dns name as the host and go to "Connection/SSH/Tunnels", there you define the local port to connect in the "Source Port" field (e.g. 3307).
In the the "Destination" field put the dns name of your mysql server followed by a colon and the port mysqld is running in (e.g. mysql.example.org:3306).
Save this as a profile then connect and the remote mysql port will be availbable locally on port 3307.
Just make sure you restrict the user because by default he will have an ssh shell on the server.
Setting up key authentication would also be practical because you won't have to enter a password to connect to the server (but be sure to protect your key on disk by encrypting it).
EDIT: It seems the mysql odbc connector support ssl, you could use that too but I'd personnally choose to use SSH anyway as you will have it already on your mysql server.