Tags » Mysql

​Step migrasi mariadb to percona-xtradb-cluster(pxc-57)

Berikut ini adalah step by step untuk migrate software database MariaDB-10.1.22 ke Percona-xtradb-cluster-57.

Arsitekur berubah dari master-slave menjadi multi master dengan 3 node

  1. Setup node1 pxc-57…
  2. 114 more words
Linux

Pure OS: The way forward?

Tonight is just a quick one, not my usual essay. I was just curious to see what other people though. Being a PHP Developer I primarily work within LAMP environments. 434 more words

General

Retrieve Result order by specific id

select * from table order by case when web_id= ‘4’ then 1 when web_id=’3′ then 2 when web_id=’6′ then 3 when web_id=’7′ then 4 when web_id=’2′ then 5 end, web_id

Mysql

WordPress search in custom post meta

Searching in custom post meta as like WooCommerce SKU.

add_filter( 'posts_where', 'codyfy_search_where' );
function codyfy_search_where( $where ){
    global $pagenow, $wpdb;
    $class_status = $_GET['s'] ? $_GET['s'] : ''; 
    if ($_GET['s'] != '') {
        $where = preg_replace(
       "/\(\s*".$wpdb->posts.".post_title\s+LIKE\s*(\'[^\']+\')\s*\)/",
       "(".$wpdb->posts.".post_title LIKE $1) OR (".$wpdb->postmeta.".meta_key LIKE '_sku' AND ".$wpdb->postmeta.".meta_value LIKE $1) ", $where );
    }
	
    return $where;
}

add_filter('posts_join', 'codyfy_search_join' );
function codyfy_search_join ($join){
    global $pagenow, $wpdb;
    if ( $_GET['s'] != '') {    
        $join .='LEFT JOIN '.$wpdb->postmeta. 18 more words
WordPress

Mysql Deadlock

Docs 

https://dev.mysql.com/doc/refman/5.7/en/innodb-deadlocks-handling.html

shared lock
A kind of lock that allows other transactions to read the locked object, and to also acquire other shared locks on it, but not to write to it. 861 more words

Database

Install LAMP Stack in minimum commands

LAMP Stack means :Linux, Apache, MySQL and PHP.

Run the following commands one by one in the terminal to install the whole LAMP Stack: 62 more words

Linux

How and why: Normalize your Data

When we talk about normalizing data within a database we really just mean that we’re organizing our data properly in order to make our database run more efficiently and reduce needless duplication. 530 more words

T-SQL