systemctl stop mysql aur systemctl disable mysql Ubuntu me kya hai?
Introduction
Aksar Ubuntu users XAMPP ya LAMP stack ke saath kaam karte waqt MySQL service conflict ka issue face karte hain. Ye problem mainly tab aati hai jab system MySQL aur XAMPP MySQL dono ek hi port (3306) use karte hain.
Is situation me aapko systemctl commands ka use karke MySQL ko stop ya disable karna padta hai.
Chaliye samajhte hain in dono commands ka actual matlab kya hai.
What is systemctl?
systemctl ek Linux utility hai jo systemd services ko manage karne ke kaam aata hai. Iske through hum kisi bhi service ko start, stop, enable, disable, restart ya status check kar sakte hain.
Command 1: sudo systemctl stop mysql
👉 Ye command MySQL service ko abhi turant stop kar deta hai.
- Matlab jo MySQL process run ho raha hai usse band kar diya jaata hai.
- Lekin system reboot ke baad MySQL fir se auto start ho jayega (agar disable na kiya ho).
Example:
sudo systemctl stop mysql
Use Case:
- Jab aapko turant MySQL band karke XAMPP ka MySQL run karna hai.
- Temporary solution ke liye best hai.
Command 2: sudo systemctl disable mysql
👉 Ye command MySQL service ko boot time par auto start hone se rokta hai.
- Matlab system restart ke baad MySQL khud se start nahi hoga.
- Agar aap chaho to manually
systemctl start mysqlrun karke start kar sakte ho.
Example:
sudo systemctl disable mysql
Use Case:
- Jab aapko long term me XAMPP MySQL use karna hai aur system MySQL ki zarurat nahi hai.
- Ye permanent solution hai jab tak aap fir se enable na karo.
Stop vs Disable — Difference in Short ⚡
- stop → Service abhi ke liye band karo (temporary).
- disable → Service ko boot ke baad auto start hone se rok do (permanent until enabled).
Re-enable MySQL Service (Agar zarurat ho)
Agar future me fir se MySQL chahiye ho to:
sudo systemctl enable mysql
sudo systemctl start mysql
Conclusion
systemctl stop mysql aur systemctl disable mysql commands aapko service conflicts solve karne me help karte hain, especially jab aapko XAMPP ka MySQL use karna ho.
- Temporary fix ke liye →
stopuse karo. - Permanent fix ke liye →
disableuse karo.
Isse aap apne Ubuntu system me easily manage kar paoge kaunsa MySQL run karna hai. ✅
Leave a Reply