Wednesday, September 26, 2012

Import or Export " .sql " or ".csv" file in/from mysql

Importing .sql  file into mysql database

1.Go to mysql command prompt.
2.Go to the database , in which you want to import a .sql file.
3.Then use the following command to import file.

          " source path-of-the-sqlfile  "

Note:  Source is the keyword  after that u have to give the path of the file where that sql file is present

Exporting a file from mysql database

1.Go to windows command prompt ( mysql path must be set in the environment variables )
2.Then use the following command to import file.

      " mysqldump -u username -ppassword databasename tablename  > filename.sql "
                                   
                                                        OR

     mysqldump -u username -ppassword databasename tablename  > give-path-where-u-want-to-store-the-sql-file/filename.sql"

Importing .csv file into mysql database

load data local infile 'E:/Sample/sample.csv' into table fing_myresult fields terminated by ',' enclosed by '"' lines terminated by '\n' (columnName1,columnName2,columnName3,columnName4)

Liferay DXP JNDI Data Source Cofiguration

 This Blog will help us to learn about the JNDI Data Source Configuration in Liferay DXP. We have tested this with Liferay 7.3 with Tomcat. ...