Making a local copy of a database - mysql

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.

Related

How to replicate data from my local phpmyadmin mysql database to godaddy cpanel mysql database?

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.

How to host the xampp's local database on the webserver

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.

How to transfer local sql server or database to another computer

I'm working on a project with 4 other guys, and we are developing an android app with a DB. Now, we are going to use a localhost for our SQL Server, I want to be able to take the database from my laptop and copy it to the other guys' computers. I"m using SQL Server 2008 Management Studio.
Any ideas of how to do it? I don't mind to copy the entire localhost server if we can do that.
BTW, I tried to backup the DB on my laptop by right-click on the DB (created .bak file) but there is no restore option on the other computer.
Thanks
Backup your data base and restore in the other machines
edit
If you dont find the restrore option, please try using sql script
ex:
RESTORE DATABASE nwind_new FROM DISK = 'c:\backups\northwind\nwind.bak'
WITH
MOVE 'northwind' TO 'd:\Program Files\Microsoft SQL
Server\Data\nwind_new.mdf'
MOVE 'northwind_log' TO 'd:\Program Files\Microsoft SQL
Server\Data\nwind_new_log.ldf'
You can try
See these links about backup and restore:
http://technet.microsoft.com/en-us/library/cc966495.aspx
and
http://blogs.msdn.com/b/sreekarm/archive/2009/09/11/move-a-database-from-one-server-to-another-server-in-sql-server-2008.aspx
To restore your database see this useful link:
http://msdn.microsoft.com/en-us/library/ms177429(v=sql.100).aspx
its weird you dont see the restore option. You could try deattaching the DB from its location, copy the files (DB and LOG) to the new location and attach it there.
MSDN

copy and create new mysql setup on server

Iam a newbie for DB. I have a running database on godaddy's mysql setup. Now i have a new server whose access is not with me. I have to make a file which can install and create new mysql on that server plus it can copy and store specific tables from my current server database too.
I have to give this file to the person who is having the access so that he can execute it and can have all the content. How can i make such a file?
You can use MySQL's mysqldump to take backup of your databases.
Alternatively, You can always backup your database using MySQL GUI tools like SQLyog.
I guess GoDaddy do not allows direct connection for mysqldump to work. In that case you can use SQLyog's HTTP tunneling capability.
Give the generated backup file (created through SQLyog or through mysqldump) to the person who has access and he will upload the file.
Here is the SQLyog's documentation for taking Backup. Select Databases and Tables that you want to backup through wizard.
Hope it helps....

How do I move data in my production server to a database on my test server : MYSQL

I have data in a table A on my prod server. I want to move the data in it into table A (same name) on my test server.
What is the simple way to do this without exporting the data into some file and then inserting into my test table?
Thanks. I Looked around S/O and couldnt find a satisfactory answer.
If you have a tool like SqlYog, it's pretty simple with a couple of clicks of the mouse, otherwise you cannot do it because a query works in the context of a db connection, and for different servers you need different connections.
If you have phpmyadmin installed on both servers do the follwing
go to the table in phpmyadmin on your prod server
click export and export as .sql
go to the table in phpmyadmin on your test server
click import and upload the .sql file
If your database is more than 8 mb you can always compress it