console

21
Sep
2011

Frequently Used Server Control Commands

Apache

Check status, start, stop, restart and reload:

  1. /etc/init.d/apache2 status
  2. sudo /etc/init.d/apache2 start
  3. /etc/init.d/apache2 stop
  4. sudo /etc/init.d/apache2 restart
  5. sudo /etc/init.d/apache2 reload

Enable/disable modules:

  1. sudo a2enmod module
  2. sudo a2dismod module

Enable/disable virtual hosts:

  1. sudo a2ensite test.my
  2. sudo a2dissite test.my

MySQL

Start, stop, restart:

  1. sudo service mysql start
  2. sudo service mysql stop
  3. sudo service mysql restart
Tags: 
Category: 
0
20
Sep
2011

How to Import Large MySQL Dumps

To import sql dumps it's commonly used PhpMyAdmin. However, if the dump is too large, there some problems can appear such as file size limit, exceeding script execution time, memory shortage and so on.

So the best solution in this case (and the proper one) is to use mysql client utility via the console. For import sql dump we should use "source" statement.

  1. tulvit@tulvit-desktop:~$ mysql -uroot -proot;
  2. Welcome to the MySQL monitor. Commands end with ; or \g.
  3. mysql> use my_db;
  4. Database changed
  5. mysql> source ~/dump.sql;
  6. ...
Category: 
0