Posts

Showing posts from 2018

MYSQL -Import Data from Delimited Data

Loading CSV or any delimited data files to MySQL Database. This is a very common task for the developer and the only thing that I think of is LOAD DATA INFILE. The LOAD DATA INFILE statement reads rows from a text file into a table at a very high speed. Here, I will explain how to get the data loaded directly from CSV to MySQL database using commands. For more information, feel free to refer https://dev.mysql.com/doc/refman/5.7/en/load-data.html a) Copy the complete CSV file data including header LOAD DATA LOCAL INFILE 'path/of/csv/file' INTO TABLE <TABLE NAME> FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' Path: '/home/user/file_name.csv' or in windows 'C:/path/file_name.csv' FIELDS TERMINATED BY ',': Divides the line data into Fields Example: A table with three columns say A,B,C and CSV file is as follows a,b,c aa,bb,cc aaa,bbb,ccc By terminating by delimited ',' fields table would look like ...

Increase EC2 root volume size

Image
Introduction: To increase EC2 Linux server's root volume size. Why was this tutorial made?  I had this issue in one of my EC2 instances where I was running Codeigniter Project. So what was the problem? Codeigniter pop-out a message saying " fopen(/var/lib/php/sessions/ci_session2be254f027bc9251bf55ddd02b09c35e5ff7a7c1): failed to open stream: No space left on device " Now I, connected to my instance using Public DNS ran df command ( report free disk space ) By running Df command, I made sure the problem was with the root volume of my EC2 instance. While creating a new instance in EC2, most Linux instances come with an 8GB root volume unless you changed it at first launch. So in my case, I made use of 8GB Volume. Solution Now, we need to increase the space of root volume attached to our EC2 instance. Step 1:  Navigate to your AWS Console and then click EC2 and then Volumes on the left panel.  Step 2: Finding th...