MySQL-Scripts

MySQL Stored procedure to Generate-Extract Insert Statement

A lot of places I saw people asking for ways to generate Insert statements. We do have GUI Tools which can extract insert statements for us readily. of the time I choose the MySQLDump way to generate insert statements. mysqldump -uroot -ppassword –complete-insert –no-create-info DATABASE TABLENAME > TABLENAME.sql But mind is very unstable and hungry, we don’t stop at one solution. So to remove my mind’s starvation for the Stored Procedure way to extract Insert statement I created following routine. As you can see this is really a simple procedure revolves around Information_schema mainly to get details of any table...

MySQL Load Data Infile Syntax Generator Tool Download

The LOAD DATA INFILE statement reads rows from a text file into a table at a very high speed. The file name must be given as a literal string. I have already written the basic how to follow that considering additional cases. A lot of questions I have seen for loading separated data to MySQL, so here I’ve created a very beginner level excel tool that will allow you to generate the LOAD DATA syntax as per your choices. Presently sample table name and field/line separators are specified, which you may alter as per your own file. Download the sheet...

Ideas for select all columns but one mysql stored procedure

Assume we’ve a table with 100 rows and we need to select all columns but one. The problem is headache of actually typing out all 99 required columns!! Solutions / Ideas to above problem are: Ignorance is bliss. Select all(*) and ignore the column. Manually type column names or manage it with copy paste! Create a view from original table and drop the unnecessary column! MySQL Database command / syntax that allows us to do this; which is not there unfortunately. Use my stored procedure to select all but one columns: No need to explain why all such hacks are...

MyDumpSplitter-Extract split database or tables from mysqldump | MySQL dump splitter

The Mysqldumpsplitter can extract database, table, all databases, all tables or tables matching on regular expression from a mysqldump. It can produce the compressed output of sqls in specified directories. The tool has undergone a complete rewrite, and there are many more functionalities added. Please follow GitHub Repository for future changes or further improvements. Download the the tool from GitHub Repository. I have prepared a separate blog post to getting started with the mysqldumpsplitter. It’s a sort of guide for doing required and possible operations with the mysql-dump-splitter script. Read the mysqldumpsplitter recipe blog post here. Current version is 6.1....

Stored procedure to add-remove prefix by rename table mysql

Here is one more procedure – (this time) for mass renaming of table. Adding and Removing table-name prefixes 🙂 A friend of mine was renaming 100+ tables by using replace methods in notepad. I showed em a bit better editor: Editplus and then I thought of rescue rest of those who are still interested in some techie-solution to such things. This procedure is outcome of that try and its as usual very simple one with two functionalities: rename mysql table of a database by adding prefix rename mysql table of a database by removing prefix So below mysql stored procedure...