IF I understand you can try
$config['database'] = 'mysql'; // other config details eg username. port, pass $this->load->database($config); $query = "INSERT INTO user (host, user, password, select_priv, insert_priv, update_priv) VALUES ('localhost', 'user', PASSWORD('mypass'), 'Y', 'Y', 'Y')"; $this->db->query($query);
My syntax may be a bit off.
Essentially - use the mysql database, insert directly into the user table.
However, some hosts may restrict access to this directive.
source share