mysqld dead but subsys locked

mysql 5.7

mysqld dead but subsys locked Backup for future Safety: cp /var/lock/subsys/mysqld /root/mysqld than delete it rm /var/lock/subsys/mysqld then close all services that depends on mysql: service httpd stop and after that: service mysqld restart service httpd restart  

C Program to find LCM of two Numbers using Recursion

LCM program example in c

C Program to find LCM of two Numbers using Recursion What is LCM LCM: Least Common Multiple of two numbers is the number that is a common multiple of the both the numbers. Below is a program to find LCM of two numbers using recursion. #include<stdio.h> int find_lcm(int, int); // function prototype declaration int main() { … Read more

PHP print Statement

php_print_statement

PHP print Statement The print statement can be used with or without parentheses: print or print(). Display Text The following example shows how to output text with the print command (notice that the text can contain HTML markup): Example <?php print “<h2>PHP is Fun!</h2>”; print “Hello world!<br>”; print “I’m about to learn PHP!”; ?> Output: PHP is Fun! Hello world! I’m about to learn PHP! … Read more

PHP substr() function

php substr function

<?php   // PHP program to illustrate substr() function Substring($str){     $len = strlen($str);     echo substr($str, 8), “\n”;     echo substr($str, 5, $len), “\n”;     echo substr($str, -5, 10), “\n”;     echo substr($str,-8, -5), “\n”; }   // Driver Code $str=”blogsforblogs”; Substring($str);   ?> Output: blogs forblogs blogs for The substr() is a built-in function in PHP that is … Read more

Impact of web hosting on online business

Compare and choose the best web hosting provider

Impact of web hosting on online business Now a days, e-commerce has moved online – and not just for big guys like Amazon, but for millions of smaller companies selling their wares and capabilities. At the same time, these business owners have also seen an increase in the options available for how they host and … Read more

Rename database in MySQL

mysql 5.7

From phpMyAdmin, select the database you want to select. In the tabs there’s one called Operations, go to the rename section. That’s all. It does, as many suggested, create a new database with the new name, dump all tables of the old database into the new database and drop the old database. Other method: Create … Read more

get the difference between two timestamps in seconds

MySQL Cluster

get the difference between two timestamps in seconds   You could use the TIMEDIFF() and the TIME_TO_SEC() functions as follows: SELECT TIME_TO_SEC(TIMEDIFF(‘2010-08-20 12:01:00’, ‘2010-08-20 12:00:00’)) diff; +——+ | diff | +——+ | 60 | +——+ 1 row in set (0.00 sec) You could also use the UNIX_TIMESTAMP() function. SELECT UNIX_TIMESTAMP(‘2010-08-20 12:01:00’) – UNIX_TIMESTAMP(‘2010-08-20 12:00:00’) diff; +——+ | diff | +——+ | … Read more

Convert decimal seconds time in Excel h:mm:ss format

convert decimal seconds to excel time

Convert decimal seconds time in Excel h:mm:ss format Generic formula =seconds/86400 Explanation To convert seconds in decimal format to a proper Excel time, divide by 86400. In the example shown, the formula in C6 is: =B6/86400 To display the result as time, apply a time format. Column D shows the same result formatted with [h]:mm. … Read more

How to identify server IP address in PHP

php how to example

How to identify server IP address in PHP   or the server ip: $_SERVER[‘SERVER_ADDR’]; and this for the port $_SERVER[‘SERVER_PORT’]; You can use this in CRUL as below: <?php // create a new cURL resource $ch = curl_init (); // set URL and other appropriate options curl_setopt ($ch, CURLOPT_URL, “http://blog.eduguru.in/test”); curl_setopt ($ch, CURLOPT_HEADER, 0); curl_setopt … Read more