Posts

Showing posts with the label MySQL

Server Fine Tuning Scripts

Provides a instant view of running resource usage https://community.rackspace. com/products/f/25/t/647 Apache Tuning scripts https://github.com/ gusmaskowitz/apachetuner (bash script) https://github.com/ gusmaskowitz/apachebuddy.pl (perl script that supercedes apachetuner) MySQL Tuning script https://github.com/major/ MySQLTuner-perl Resource usage logging https://github.com/rackerlabs/ recap

How to fetch the no: of weekly inserted records in MySQL

Image
SELECT   COUNT(*) AS reports_in_week,   DATE_ADD(created_at, INTERVAL(1-DAYOFWEEK(created_at)) DAY) as start_day,   DATE_ADD(created_at, INTERVAL(7-DAYOFWEEK(created_at)) DAY) as end_day FROM   your_table_name GROUP BY   YEAR(created_at) + .01 * WEEK(created_at) The desired output will be.

How to reset MySQL Root password

service mysqld stop (To stop the currently running MySQL instance) mysqld_safe --skip-grant &   (To enter into MySQL in safe mode) use mysql; update user set password=PASSWO RD("NEW-ROOT-PASSWORD" ) where User='root';   (To set the new root password) service mysqld restart (To restart the MySQL instance)