How to start/stop MySql server on Ubuntu, RedHat Linux and OSX

Debian / Ubuntu

# To install MySql database:
sudo apt-get install mysql-server

# To check the status of  MySql server:
/etc/init.d/mysql status

# 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

RedHat Linux (Fedora Core/Cent OS)

# 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
OR
service:
# service mysqld start
# service mysqld stop
# service mysqld restart

OSX

# To check the status of  MySql server:
sudo /usr/local/mysql/support-files/mysql.server status

# To start mysql server:
sudo /usr/local/mysql/support-files/mysql.server start

# To stop mysql server:
sudo /usr/local/mysql/support-files/mysql.server stop

# To restart mysql server
sudo /usr/local/mysql/support-files/mysql.server restart

No comments:

Post a Comment