Mysql

Uninstall MySql on a Mac OS X

To uninstall MySQL and completely remove it (including all databases) from your Mac do the following: Open a terminal window and use mysqldump to backup your databases.Stop the database server sudo [...]

Back Up MySQL Databases From The Command Line

mysqldump command in mysql helps to create textfile dumps of databases. here is few commands to do in commandline Single Database backup: mysqldump –u[user name] –p[password] database_na [...]

Getting weeks between two dates in MySql

DELIMITER $$ DROP PROCEDURE IF EXISTS `sp_getDateFormat` $$ CREATE PROCEDURE `sp_getDateFormat`(StartDate varchar(15), EndDate varchar(15), Cond varchar(5)) READS SQL DATA DETERMINISTI [...]

Creating new mysql user using query

CREATE USER 'username'@'localhost' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON *.* TO 'username'@'localhost' WITH GRANT OPTION; CREATE USER 'username'@'%' IDENTIFIED BY 'password'; GRANT ALL PRI [...]

Install MySQL as window service

1. Open your command prompt. 2. Locate your mysql installed directory 3. Type the physical path up to mysql bin directory in commanfd prompt 4. and type  --install MySQL --defaults-file=C:\m [...]