| | |
| | | |
| | | $cf = $conf['mysql']; // make $conf['mysql'] more accessible |
| | | //** Create the database |
| | | if(!$this->db->query('CREATE DATABASE IF NOT EXISTS '.$cf['database'])) { |
| | | if(!$this->db->query('CREATE DATABASE IF NOT EXISTS '.$cf['database'].' DEFAULT CHARACTER SET '.$cf['charset'])) { |
| | | $this->error('Unable to create MySQL database: '.$cf['database'].'.'); |
| | | } |
| | | |
| | |
| | | $this->error('Stopped: Database already contains some tables.'); |
| | | } else { |
| | | if($cf['admin_password'] == '') { |
| | | caselog("mysql -h '".$cf['host']."' -u '".$cf['admin_user']."' '".$cf['database']."' < '".ISPC_INSTALL_ROOT."/install/sql/ispconfig3.sql' &> /dev/null", |
| | | caselog("mysql --default-character-set=".$cf['charset']." -h '".$cf['host']."' -u '".$cf['admin_user']."' '".$cf['database']."' < '".ISPC_INSTALL_ROOT."/install/sql/ispconfig3.sql' &> /dev/null", |
| | | __FILE__, __LINE__, 'read in ispconfig3.sql', 'could not read in ispconfig3.sql'); |
| | | } else { |
| | | caselog("mysql -h '".$cf['host']."' -u '".$cf['admin_user']."' -p'".$cf['admin_password']."' '".$cf['database']."' < '".ISPC_INSTALL_ROOT."/install/sql/ispconfig3.sql' &> /dev/null", |
| | | caselog("mysql --default-character-set=".$cf['charset']." -h '".$cf['host']."' -u '".$cf['admin_user']."' -p'".$cf['admin_password']."' '".$cf['database']."' < '".ISPC_INSTALL_ROOT."/install/sql/ispconfig3.sql' &> /dev/null", |
| | | __FILE__, __LINE__, 'read in ispconfig3.sql', 'could not read in ispconfig3.sql'); |
| | | } |
| | | $db_tables = $this->db->getTables(); |