I have read-only access to a remote MySQL database, which contains a very large table (hundreds of millions of lines).
To get faster access to that table, I want to copy it to my local database.
What is the best way to do this?
“SELECT INTO OUTFILE” doesn’t work, because I don’t have the required permissions on the remote database.
I tried to use Java to SELECT all rows FROM the remote table, save them to a local text file, then use LOAD DATA INFILE; however, the select broke with
“Exception in thread “main” java.lang.OutOfMemoryError: Java heap space”.
Use the mysqldump command on the remote database to extract the SQL statements of the database required. Then copy the extracted file to your local system and execute the sql file which will create the database in the local system.
Here is the mysqldump example
http://www.roseindia.net/tutorial/mysql/mysqlbackup/mysqldump.html