Posts

Showing posts with the label mySql
Grants privileges to MySQL user CREATE USER  'root'@'localhost' IDENTIFIED BY 'pass'; pass : enter your password Grant full rights GRANT ALL ON *.* TO 'root'@'localhost'; more info http://dev.mysql.com/doc/refman/5.1/en/grant.html

Calculate table size and index size in Mysql

Calculate table size and index size in Mysql mysql> SELECT table_name, `engine` ,ROUND ( data_length/ 1024 / 1024 , 2 ) total_size_mb, ROUND ( index_length/ 1024 / 1024 , 2 ) total_index_size_mb, table_rows FROM information_schema. TABLES WHERE table_schema = 'SalesDB' ORDER BY 3 ; SalesDB -- Database name total_size_mb -- Total size in MB query result table_name engine total_size_mb total_index_size_mb table_rows Customers InnoDB 0.45 0.11 1257 Invoices InnoDB 1.73 1.21 12785

Enabling the MySQL Event Scheduler

Enabling the MySQL Event Scheduler After installation, be sure to enable the scheduler(new mysql installations have it off by default) to check status: Code: SELECT @@event_scheduler; to enable: Code: SET GLOBAL event_scheduler = 1; Execute mysql stored procedure call UpdateSales 'UpdateSales' <-- stored procedure name