allow root remote access mysql / mariadb on centos6

edit file /etc/my.cnf.d/server.cnf

[mariadb]
bind-address = 0.0.0.0

like that

then login to your mysql using root login

server@remote $ mysql -u root -p

mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'yourpasswordroot' WITH GRANT OPTION;
mysql> FLUSH PRIVILEGES

server@remote # service mysql restart

then do your fucking job.

Advertisements

update data session variable codeigniter framework

how to update session codeigniter with update data in table this my controller function?

function update(){
	$data = $this->session->userdata('logged_in');
	$data['nama'] = $this->input->post('nama');
	$data['umur'] = $this->input->post('umur');
	$this->db->set('nama', $this->input->post('nama'););
	$this->db->set('umur', $this->input->post('umur');)
	$this->session->set_userdata('logged_in', $data);
}

done bro.