Q:

frequent automatic restart of mysql server and later permanent shutdown

The MySQL server is restarting frequently.  75 times in less than 24 hours.  And finally its ending without restarting! 
Please check the details log here: mysqld.log
140113 10:18:22 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

140113 10:18:31 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
140113 10:18:31  InnoDB: Initializing buffer pool, size = 8.0M
140113 10:18:31  InnoDB: Completed initialization of buffer pool
140113 10:18:31  InnoDB: Started; log sequence number 16 1064411530
140113 10:18:32 [Note] Event Scheduler: Loaded 0 events
140113 10:18:32 [Note] /usr/libexec/mysqld: ready for connections. 
Version: '5.1.61'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  Source distribution

140113 18:45:09 mysqld_safe Number of processes running now: 0
140113 18:45:10 mysqld_safe mysqld restarted
140113 18:45:10  InnoDB: Initializing buffer pool, size = 8.0M
140113 18:45:10  InnoDB: Completed initialization of buffer pool
140113 18:45:10  InnoDB: Started; log sequence number 16 1064411530
140113 18:45:11 [Note] Event Scheduler: Loaded 0 events
140113 18:45:11 [Note] /usr/libexec/mysqld: ready for connections. 
Version: '5.1.61'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  Source distribution

......
140114  9:50:12  InnoDB: Initializing buffer pool, size = 8.0M
140114  9:50:12  InnoDB: Completed initialization of buffer pool
140114  9:50:12  InnoDB: Started; log sequence number 16 1064411530
140114  9:50:13 [Note] Event Scheduler: Loaded 0 events
140114  9:50:13 [Note] /usr/libexec/mysqld: ready for connections. 
Version: '5.1.61'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  Source distribution

140114 09:55:07 mysqld_safe Number of processes running now: 0
140114 09:55:07 mysqld_safe mysqld restarted
140114  9:55:08  InnoDB: Initializing buffer pool, size = 8.0M
140114  9:55:08  InnoDB: Completed initialization of buffer pool
140114 09:55:08 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

In the meantime its killing 62 processes due to out of memory.  Please check the detail log: messages
Jan 14 09:41:53 centos63 kernel: Out of memory: Kill process 16795 (mysqld) score 20 or sacrifice child
Jan 14 09:41:53 centos63 kernel: Killed process 16795, UID 27, (mysqld) total-vm:574508kB, anon-rss:20488kB, file-rss:164kB

I am running a cronjob in each 5 minutes which is affecting some tables with about 200000, 50000, 25000 data in three tables. 
SELECT over 1,257 members then over 9,844 member_boards and then INSERT/UPDATE over 168,624 member_cards using the below pseudocode:
<? php
    $qry = _("SELECT _members");
    while($member = mysql_fetch_assoc($res))
    {//1,257
        $qry = _("SELECT _member_boards");
        while($db_board = mysql_fetch_assoc($board_res))
        {//9,844
            $s_lists = curl_download("https://api.com/boards/lists");
            foreach ($lists as $list) {//9,844
                if(!strcmp('SOMETHING', $list->name)){//Matching with API and DB
                    $curl = "https://api.com/lists/cards";
                    foreach ($cards as $card) {//168,624
                        $qry = _("SELECT _member_cards");
                        if($card_row = mysql_fetch_assoc($card_res)){
                            $qry = _("UPDATE _member_cards");
                        }
                        else{
                            echo $qry = _("INSERT _member_cards");
                        }
                    }
                }
            }

        }
        $qry = _("UPDATE _member_cards");
    }
? >

So what can be the reason and how can I solve this issue? 
RAM 512 MB until now. 
CentOS
Can scaling RAM up to 1 GB solve the issue? 

A:

Your MySQL server is getting killed because it uses too much memory; you can either add more RAM to the server or try lowering MySQL's memory usage by changing some values in its configuration file; however that may affect performance. 
Take a look at this question and this one for guides about tweaking MySQL's configuration - it's not an easy task and it's based on trial and error, you should try different values until you get a good balance between performance and memory usage.