Skip to main content

Posts

Showing posts from December, 2019

XML tools on linux

Hello friends, Welcome back 🙂 In this article, we're going through XML tools which are useful for manipulation of XML. Recently I've worked on 3 tools so for now, adding those 3 tool's information, but as I get more, I'll update the article. These tools useful for validation and split/merge the XML. These tools available on both RHEL family and Debian family  linux which are same in use for both debian and RHEL. The tools are: 1. xmllint: This tool is used for xml validation. For some reason, we need to validate XML tags with its proper openings and closing i.e. syntactic validation, also we need to validate the data in the XML. The data can be different by its type which is defined in the XML's DTD, to detect this also, xmllint is useful. With this tool, there are multiple options we can use i.e. only syntactic validation, schema validation, DTD validation etc. When I was facing issue for validating the XML which having schema, I found this tool. H...

MVC Architecture - In depth

Hello friends, Welcome back 🙂. In this article, I’m writing about which the new developers consider a very big concept. The MVC What is MVC? MVC is actually a design pattern or a development architecture which is specifically used in developing dynamic web applications. It also can be used for static web applications. There are also other design patterns which are frame-worked for accomplishing specific development architecture. The MVC right now is used for implementing dynamic web applications, static web sites, desktop applications etc. MVC Purpose The major purpose of MVC design pattern is to segregate the code snippets based on their use. M stands for MODEL in which specifically db and data related operations performed. V stands for VIEW in which view related operations performed. And finally C for CONTROLLER which co-ordinates between Models and Views. So due to the separation of codes by above sections, team work becomes easy and code maintenan...

Dump `mysql` db by tables

Hello friends, Welcome back again. In this story, I’m going to explain how to export mysql database by tables. When we use `mysqldump` command for exporting entire database, it actually exports db in a single file. For some reason, I need to export all tables from a database but in separate/split files but it was not possible by using `mysqldump`. So I googled for it and I found solution, which I’m sharing here with you. Actually this is a small bash shell script, through which I’ve exported database into multiple files by table. This bash shell script runs on linux. For windows/mac, I’ll share solution as I get. Linux Code: Execute above code in terminal, it will ask every time for password, if you want to avoid of asking password, then add your password after -p parameter in `mysqldump` command. Enjoy coding 😃 Thanks.

Recover messed up/lost UTF-8 characters in MySQL db

Hi friends, This was my first story on medium, now copying as it is on blogger. In this note, I’m going to explain you what are the messed up/lost/bad utf-8 characters and how to recover them to original in MySQL db. What is messed up/lost/bad utf-8 characters? The messed up or lost or bad characters are those characters which are normal if we convert it to UTF-8, but due to mistakes while import/export, that characters not display properly. Consider following example: Ã¥¾Ë†Ã¥¥½Ã§Å¡„产品。就是没货了 The above sentence is actually a Chinese sentence, but while import/export from db, it’s get messed up. How to recover them? To recover the messed up characters, we should convert them first into binary form, then convert that binary string to UTF-8 string, that’s it! To do this, use following SQL: In above SQL, we firstly converted data of varcharColto binary form using MySQL’s CAST function. Then converted that binary string to UTF-8 using CONVERT function. Aft...