Monday, September 9, 2013

Import/Export MySQL

Generally speaking importing and exporting data in the MySQL is not a difficult task and there are three different ways specified for the efficient working. The first method is to perform it through graphical means with the help of  phpMyAdmin while the method is not highly recommended in case of uploading heavy files on system. The next method is the utilization of the SSH tunnel in which a third party is used to execute the importing function for the system. The last method is to make use of the command line client for MySQL through the SSH connection.

As there are different ways used to develop the backup or restoring for the MySQL yet there are some limitations in each method. The best way recommended is to perform the task locally which helps in dumping of data on the disk in a much faster speed. By simply using the dumping procedure as well as utilities one can perform the task in much better time and error free method. 

Import data of MySQL

One of the widely used methods for restoring or importing data on the server is to start creating with the username for MySQL. Once the account information is made that includes a database, password and username, one is ready for the further proceedings.

·         Upload the dump file of the SQL to the account from the database. Majority files can be recognized with .sql extensions.

·         The file will contain the necessary statements and the tables on which the action of reinserting will be performed. 

·         After uploading of the file, a SSH account is required and a special command is run to make it function. 

·         Replace the mysqluser with the username created by you while the statement of mysqldb will be substituted with the database of the sql created. While the last statement of dbfile.sql will be replaced with the name of the respective sql dump file location.
·         A password will be needed for the necessary action and once it matches with the system, it will immediately load the data. Any error in the dump file path will result in failure in uploading of the file.

Export data for MySQL

·         Exporting the data is convenient when compared to the steps followed for importing. Yet the first step for both the tasks remains the same as one need to create the SSH account.

·         Once the SSH account is generated we will take the same example of the previous statement. The command that has been used to initiate the process earlier. 

·         The next step is to provide the username and password to the system that will further helps in replacing the required statement. 

·         As soon as the password matches with the system, there will be a file created that contains the data on the home directory. Further FTP can be sued in order to download the given file. 

·         If the file is not to be used again after downloading, it is highly recommended to delete it on order to not to be used for the server in future.


Post a Comment