How to optimize MySQL automatically in CentOS Linux

CK CK 3776 
Created at
Updated at  
1,006 0 0

I am using CentOS Linux for service purpose. Main reason to use CentOS is cheaper hosting for private purpose. Actually MySQL requires periodical optimization process in my experiences, and I use /etc/cron.hourly usually for those kind of bath processing. 

I made 'koptimize' file with permission 0755. 

 % vi /etc/cron.hourly/koptimize

 

Please type as below with database ID, and Password can perform optimization. It may require administrator permission or something similar with that. 

# database optimization
mysqlcheck --auto-repair -u(Root ID) -p(Root Password) --all-databases

 

After storing above file, you need to change file permission for automatic execution as below. 

chmod 755 /etc/cron.hourly/koptimize

Eventually koptimize file will be executed hourly.

Tags CentOS bash cron db autorepair httpd metaWeblog API file attachment mysqlcheck mysqld timeout Facebook X
Comments 0
Similar posts
  1. Apache server unstable detection and the related server(mysql, apache) restart automatically
    530
  2. mysql optimization – if you are using Word Press, do not turn off persistent connection
    586
  3. File conversion to UTF in Schell Script
    1,019
  4. Set timezone and time on Centos 6.7
    539
  5. mcrypt missing when using phpMyAdmin on Centos 6.7
    545
  6. Adding new cron job for automated processing on every 10 minutes on Centos 6.7
    1,328
  7. Setup Apache+PHP+MySQL on Centos 6.7
    605
  8. Configuring IP Address on Centos 6.7
    783
  9. How can I increase MySQL max connections?
    457
  10. SQL to Select a random row from a database table
    533
  11. How to mount windows shared folder on Centos 6.8 - mount error 12 = Cannot allocate memory to the mount.cifs(8)
    911
  12. Generate Let’s Encrypt Wildcard SSL Certificate
    619
  13. Upgrading to GCC 4.9.4 in CentOS 7 requires installing a newer version manually
    578
  14. Default Timeout for Amazon Bedrock invoke_model
    732
  1. Bash script to install postfix and sasl for sending email
    1,190
  2. Guide for tmux shortcuts - split current pane, toggle pane
    1,292
  3. Tistory remote blogging example based in CLI & PHP
    2,698
  4. Generate Let’s Encrypt Wildcard SSL Certificate
    619
  5. Preventing Unauthorized Image Crawling by Bots: A Clever Discovery and How to Address It
    1,724
  6. Network diagnostic tool for IPv4/IPv6 - traceroute/traceroute6
    1,911
  7. chmod by type (directory and file permission)
    732
  8. Check network port is open or not on CentOS 7
    1,185
  9. Change MySQL port number for security purpose
    815
  10. CentOS warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory on CentOS 7
    1,066
  11. Set up an SMTP server on CentOS 7
    718
  12. How to mount windows shared folder on Centos 6.8 - mount error 12 = Cannot allocate memory to the mount.cifs(8)
    911
  13. Configuring IP Address on Centos 6.7
    783
  14. Adding new cron job for automated processing on every 10 minutes on Centos 6.7
    1,328
  15. Set timezone and time on Centos 6.7
    539
  16. File conversion to UTF in Schell Script
    1,019
  17. Server status checking by Shell Script
    1,509
  18. How can I increase MySQL max connections?
    457
Recently updated
  1. How do I create animated background for Google Meet?
    18,995
  2. MaxMind GeoLite2 vs. DB-IP Lite vs. ip-api.com: Choosing the Right Free IP Geolocation Solution
    192
  3. Meet Valkey: Why Redis Changed Its License, Why Valkey is Better, and How to Use It as a Drop-in Replacement
    75
  4. How Rogue Web Scrapers Are Stealing My Content and Destroying My Server
    151
  5. Array of arguments passed to script in PHP
    83
  6. Invalid Auction Storms in Ad Tech
    91
  7. Building MRC-Compliant Instrumentation in Ad Tech: Implementation Steps and Key Challenges
    194
  8. The Two Clocks of Ad Server Architecture
    61
  9. Frequency Cap Architecture Overview
    505
  10. Collecting Proof-of-Play from 100,000 Screens
    139
  11. Vector Search in Relational Databases (RDBs): Trends & Usage Environments
    276
  12. What is RedisVL?
    102
  13. Designing a Skill Registry Architecture: Minimize Token Usage and Maximize AI Performance
    218
  14. TPU & GPU Cluster Management Tools
    229
  15. The Concept of Scaffolding in AI Agents
    217
  16. Beyond Static Pipelines: Architecting LLM Multi-Agent Systems for Autonomous Workflow Orchestration
    568
  17. AI-DLC vs. AI-SDLC: Model-Centric vs. System-Centric AI Development
    246
  18. Fine-Tuning Open-Weight LLMs: Training, Licensing, and Deploying Custom Models with Ollama
    321
  19. Inside the Next-Generation Streaming Architecture: Ultra-Low Latency, SGAI, and AI Codecs
    196
  20. Machine Learning: Training vs. Ranking
    200
  21. The Continuous Learning Machine: Designing a Loop That Actually Turns
    212
  22. The Next-Gen Low-Latency Standards: LL-HLS & MoQ
    188
  23. Designing a Data Curation System Around a Vector Database
    212
  24. Extracting Context from Live Video: The Architecture Got Simpler When We Stopped Building Features
    228
  25. The New Ad Stack Behind Live Sports Streaming: Inside SGAI, EABN, and the Standards Race to Fix Live Monetization
    646
  26. Designing MLOps Architectures to Handle Seasonal Data Drift in EV Fleet Models
    179
  27. From 15 to 40+ FPS: Accelerating PyTorch Object Detection on Automotive ECUs
    203
  28. Understanding Data Lineage
    251
  29. System Requirements and Architecture: Intelligent Priority-Based Scheduler
    159
  30. GPU & LLM Cluster Infrastructure & Task Scheduling Architecture
    229