I have made a database locally using Xampp and now i want that database to be hosted on webserver. i have no idea how to do so i have also searched but i'm unable to get any proper tutorial or detailed guide for this. Really looking forward for some guideline, Thanks.
If you have access to PhpMyAdmin on the target Webserver, you could create a Database dump of your local Database via PhpMyAdmin (select your Db, then Click "Export") which you can then import into the target Server.
export your database and save.
Upload into webserver.
Create database,user and setting user previlages in remote host.
import the sql.
Done.
if the sql file is large, better process with ssh.
Related
I have created a website that is hosted. The database it uses is connected locally. I created the database in MySQL workbench. How can I "host" this database remotely so that when using the website it can be accessed from any machine? Thanks
The first thing to check is whether or not your hosting supports MySQL (which many do).
If it does, create a database there, export your schema using MySQL Workbench and then import it into your new database using whatever import function your hosting provides (e.g. via PHPMyAdmin).
Then change your code to connect to your new database on localhost when it runs on the hosting server (note that there may be limitations on what you can call the database).
Otherwise you will have to do what #BrankVictoria suggests in their comment - much harder. To be honest if there's no MySQL support I'd be thinking about changing my hosting.
I am having a MySQL database in my local machine (in XAMPP) that I access using phpmyadmin. I also have a website hosted on Godaddy. I generally stay offline and make changes into data stored into database.
I want to know how can I auto replicate the changes in local database to the one in Godaddy's server or can replicate using click of a button.
I have seen some answers that told about replication but I am unable to replicate data from my local machine to the Godaddy's server.
Can anyone please tell me the steps to replicate database in simplest way.
Thank you in advance!
After lot of searching and learning, I finally found an answer to this question.
On shared hosting, Godaddy do not provide access to the configuration files of mysql (my.ini). So the replication of data is not possible using master slave replication from local(master) to remote(slave) MySQL.
The only thing that can be done is, one can create a log file of all the data that are being entered into database while the user is offline (maybe a XML file) which contains the data that is not transfered to the global database, and can upload the file when connected to the internet and parse the XML to send data to the global database.
Currently I'm connecting to mysql databases on a dev server, but I want to make a copy of those databases on my local machine that I can connect to without connecting to the dev server. Is there an easy way to do this? I'm using DataGrip.
Thanks.
You can dump your schema from the context menu like on the picture
I'm not familiar with DataGrip, but if you're using MYSQL, just log in on the website and go to your phpmyadmin, from there you can select the database you want, and click the EXPORT button, and you can choose the type of file to save it as. If DataGrip is a database tool, you should be able to save as an SQL file, otherwise maybe save as a CSV.
I've been developing a client's site and have maintained .sql backups using Export of phpMyAdmin. Yesterday my client provided me with credentials for the destination server and asked if I could migrate the development site to the beta site.
I can copy the files, of course, and I have changed wp-config.php to point to the new database correctly. When I load the page initially a default WordPress installation is created.
Unfortunately, I was not provided cPanel or phpMyAdmin credentials.
Ideally, there would be a plugin or script that would drop all of the existing tables created by default and use my .sql export to recreate the tables and populate them with data.
Does anyone know if there is a way to import this .sql from within WordPress?
You can import it with mysql on the command line:
mysql -u someuser -p password <yoursqlfile.sql
Or you can open it in mysql workbench (download from mysql.com) and run it from there.
In case you cannot SSH to the server or access the database via workbench as Norbert suggested, you can try XCloner.
It would be better if you had some sort of direct access to the database, but I'm guessing if you do not have cpanel access you also do not have SSH access. It is also common for databases to be restricted to local access, so a remote connection via MySQL Workbench may not be an option.
If for whatever reason none of these solutions work, you can temporarily connect the site to a remote database that you have access to until you get the necessary credentials from the client.
I have a local Perl script that does a lot of parsing of web pages and then successfully updates my local MySQL database (WAMP server). I now want to send this local data to my remote server, but remotely connecting to my database isn't allowed with my hosting company. Unfortunately I never thought of that problem.
So, I now need to find an automated way to update my remote server (every 15mins). I mistakenly thought I could just edit my Perl script with the details of the remote server.
I am aware that I could use CGI or PHP to do the parsing on the server, but I really want to keep the parsing local for now.
Summary:
Local MySQL database -> remote MySQL database every 15mins ??
Any ideas what I can do?
Thanks :-)
if replication is not an option but you can still establish an ssh connection from local box to remote box, then
run mysqldump to export data into a file http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html#option_mysqldump_where
scp file to remote box
mysql -u username -p password database_name < dumpfile.sql
If your server does not accept connections to mysql remotely you can create a ssh tunnel. Then you can apply the replication solution proposed by matcheek.
Here is a hint: http://realprogrammers.com/how_to/set_up_an_ssh_tunnel_with_putty.html
Based on the responses I've received, I think the answer to my original question is to stop using a cheap shared hosting company (no remote access to server, no cron jobs, etc) and start using a VPS hosting company. That will give me the freedom to remotely connect to my server, etc.
Thanks again to those who replied.
From how you described the problem replication seems to be the way to go
http://dev.mysql.com/doc/refman/4.1/en/replication-howto.html
Using a cron job could be another option. It would read file from your local machine and import data in the remote box.
I suggest the follwing:
On every local run, write the SQL statements (sans SELECT),
that you run against your copy of the DB also into a file
On your WAMP server create a small PHP script, gives back the oldest script from the first step (soem auth ofcourse)
On your remote server run a cronjob, that gets this from your local server and runs the SQL against the DB, then acknowledges it
On acknowledgement on your WAMP server, drop the file and give back the next one.
While this seems complicated, it allows for a restart after connectivity loss - something that I consider imposrtant.