Browsing articles tagged with

database

Mysql autoincrement column that resets every month

There are situations when we need an autoincrement field to reset every month or so. Example : Invoice Numbers : Month of october 2011-10-01 2011-10-02 ... ... ... 2011-10-800 Month of november 2011-11-01 2011-11-02 ... ... and so on. Groupwise autoincrement P1 , P2 , Q1 , Q2 , Q3 , Q4 , P3 , R1 , P4 ... Myisam table has a feature where , if a primary key contains 2 columns where one is an autoincrement ...

Import mysql dump files with view definer and sql security

Views and mysqldump A little back I tried to backup a database from my webhost and restore it on my localhost mysql. It had a few views. The import of the sql file seemed to work fine. But on accessing the views in phpmyadmin mysql gave the error : #1449 - There is no 'projects'@'localhost' registered The problem is with a security feature ...



Connect with us