2. Start / Stop / Restart MySQL Service
Each Linux distribution comes with a shell script (read as service) to restart / stop / start MySQL server. First login as root user and open shell prompt (command prompt).
A) If you are using MySQL on RedHat Linux (Fedora Core/Cent OS) then use following command:
To start MySQL Server: /etc/init.d/mysqld start
To stop MySQL Server: /etc/init.d/mysqld stop
To restart MySQL Server: /etc/init.d/mysqld restart
Tip: Redhat Linux also supports service command, which can be used to start, restart, stop any service:
# service mysqld start
# service mysqld stop
# service mysqld restart
(B) If you are using MySQL on Debian / Ubuntu Linux then use following command:
To start MySQL Server: /etc/init.d/mysql start
To stop MySQL Server: /etc/init.d/mysql stop
To restart MySQL Server: /etc/init.d/mysql restart
(C) If for security reasons MySQL is not configured to START / STOP / RESTART as a service:
To Stop / Shut Down MySQL Server: /usr/local/mysql/bin/mysqladmin -uroot -p shutdown
To Start MySQL Server: /usr/local/mysql/bin/mysqld_safe –user=mysql &
To Restart MySQL Server: First stop MySQL Server then Start MySQL
Leave a Reply