Eximstats dissapeared/eliminated after cpanel upgrade - email
Today I was reviewing my server and the Eximstats database dissapeared! but I see like a new design so I assumed that Cpanel/WHM was autoupdated.
I thought it was a mistake and i have to just repair the database, but the email delivery log still works, so I do not know where this information is being pulled from.
I tried repairing the database and the repair tool deletes the database! Is like a new structure!
I am wondering if anybody knows if there is any version of exim that does not use eximstats database, if the information is pulled from a different database or file, and how to read again this database.
I need that database as I had an app developed using this database.
Thanks for your help!
Since version 64, cPanel moved eximstats data from MySQL to SQLite3. The new database is located in /var/cpanel/eximstats_db.sqlite3 and the tables are slightly changed. The time is now recorded as unix timestamps and a few things are gone (like the unique ids which were mostly pointless anyway). Hope this helps.
The eximstats database structure is as follows (the default tables as per cPanel/WHM install):
-- MySQL dump 10.15 Distrib 10.0.30-MariaDB, for Linux (x86_64)
--
-- Host: dbv1.gazduire.ro Database: eximstats
-- ------------------------------------------------------
-- Server version 5.5.27
/*!40101 SET #OLD_CHARACTER_SET_CLIENT=##CHARACTER_SET_CLIENT */;
/*!40101 SET #OLD_CHARACTER_SET_RESULTS=##CHARACTER_SET_RESULTS */;
/*!40101 SET #OLD_COLLATION_CONNECTION=##COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET #OLD_TIME_ZONE=##TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET #OLD_UNIQUE_CHECKS=##UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET #OLD_FOREIGN_KEY_CHECKS=##FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET #OLD_SQL_MODE=##SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET #OLD_SQL_NOTES=##SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `defers`
--
DROP TABLE IF EXISTS `defers`;
/*!40101 SET #saved_cs_client = ##character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `defers` (
`mailtime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`msgid` char(16) NOT NULL DEFAULT '',
`email` char(255) NOT NULL DEFAULT '',
`transport_method` char(45) NOT NULL DEFAULT 'remote_smtp',
`host` char(255) NOT NULL DEFAULT '',
`ip` char(46) NOT NULL DEFAULT '',
`message` char(240) NOT NULL DEFAULT '',
`router` char(65) NOT NULL DEFAULT '',
`deliveryuser` char(30) NOT NULL DEFAULT '',
`deliverydomain` char(255) NOT NULL DEFAULT '',
`unique_id` int(11) unsigned NOT NULL DEFAULT '1',
PRIMARY KEY (`mailtime`,`msgid`,`email`,`unique_id`),
KEY `email_mailtime_index` (`email`,`mailtime`),
KEY `msgid_mailtime_index` (`msgid`,`mailtime`),
KEY `deliverydomain_mailtime_index` (`deliverydomain`,`mailtime`),
KEY `deliveryuser_mailtime_index` (`deliveryuser`,`mailtime`),
KEY `email_deliveryuser_mailtime_index` (`email`,`deliveryuser`,`mailtime`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = #saved_cs_client */;
--
-- Table structure for table `failures`
--
DROP TABLE IF EXISTS `failures`;
/*!40101 SET #saved_cs_client = ##character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `failures` (
`mailtime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`msgid` char(16) NOT NULL DEFAULT '',
`email` char(255) NOT NULL DEFAULT '',
`transport_method` char(45) NOT NULL DEFAULT 'remote_smtp',
`host` char(255) NOT NULL DEFAULT '',
`ip` char(46) NOT NULL DEFAULT '',
`message` char(240) NOT NULL DEFAULT '',
`router` char(65) NOT NULL DEFAULT '',
`deliveryuser` char(30) NOT NULL DEFAULT '',
`deliverydomain` char(255) NOT NULL DEFAULT '',
`unique_id` int(11) unsigned NOT NULL DEFAULT '1',
PRIMARY KEY (`mailtime`,`msgid`,`email`,`unique_id`),
KEY `email_mailtime_index` (`email`,`mailtime`),
KEY `deliverydomain_mailtime_index` (`deliverydomain`,`mailtime`),
KEY `deliveryuser_mailtime_index` (`deliveryuser`,`mailtime`),
KEY `email_deliveryuser_mailtime_index` (`email`,`deliveryuser`,`mailtime`),
KEY `msgid_mailtime_index` (`msgid`,`mailtime`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = #saved_cs_client */;
--
-- Table structure for table `sends`
--
DROP TABLE IF EXISTS `sends`;
/*!40101 SET #saved_cs_client = ##character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sends` (
`mailtime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`msgid` char(16) NOT NULL DEFAULT '',
`email` char(255) NOT NULL DEFAULT '',
`processed` enum('0','1','2','3') NOT NULL DEFAULT '0',
`user` char(30) NOT NULL DEFAULT '',
`size` int(11) unsigned NOT NULL DEFAULT '0',
`ip` char(46) NOT NULL DEFAULT '',
`auth` char(30) NOT NULL DEFAULT '',
`host` char(255) NOT NULL DEFAULT '',
`domain` char(255) NOT NULL DEFAULT '',
`localsender` enum('0','1') NOT NULL DEFAULT '1',
`spamscore` double NOT NULL DEFAULT '0',
`unique_id` int(11) unsigned NOT NULL DEFAULT '1',
PRIMARY KEY (`mailtime`,`msgid`,`email`,`unique_id`),
KEY `mailtime_domain_user_msgid_index` (`mailtime`,`domain`,`user`,`msgid`),
KEY `user_mailtime_index` (`user`,`mailtime`),
KEY `msgid_user_index` (`msgid`,`user`),
KEY `domain_user_mailtime_index` (`domain`,`user`,`mailtime`),
KEY `email_mailtime_user_index` (`email`,`mailtime`,`user`),
KEY `user_mailtime_spamscore_ip_index` (`user`,`mailtime`,`spamscore`,`ip`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = #saved_cs_client */;
--
-- Table structure for table `smtp`
--
DROP TABLE IF EXISTS `smtp`;
/*!40101 SET #saved_cs_client = ##character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `smtp` (
`mailtime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`msgid` char(16) NOT NULL DEFAULT '',
`email` char(255) NOT NULL DEFAULT '',
`processed` enum('0','1','2','3') NOT NULL DEFAULT '0',
`transport_method` char(45) NOT NULL DEFAULT 'remote_smtp',
`transport_is_remote` enum('0','1','2','3') NOT NULL DEFAULT '1',
`host` char(255) NOT NULL DEFAULT '',
`ip` char(46) NOT NULL DEFAULT '',
`deliveredto` char(255) NOT NULL DEFAULT '',
`router` char(65) NOT NULL DEFAULT '',
`deliveryuser` char(30) NOT NULL DEFAULT '',
`deliverydomain` char(255) NOT NULL DEFAULT '',
`counteddomain` char(255) NOT NULL DEFAULT '',
`countedtime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`countedhour` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`unique_id` int(11) unsigned NOT NULL DEFAULT '1',
PRIMARY KEY (`mailtime`,`msgid`,`email`,`deliveredto`,`router`,`unique_id`),
KEY `msgid_index` (`msgid`),
KEY `deliverydomain_mailtime_index` (`deliverydomain`,`mailtime`),
KEY `deliveryuser_mailtime_index` (`deliveryuser`,`mailtime`),
KEY `email_mailtime_index` (`email`,`mailtime`),
KEY `email_deliveryuser_mailtime_index` (`email`,`deliveryuser`,`mailtime`),
KEY `processed_transport_is_remote_index` (`processed`,`transport_is_remote`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = #saved_cs_client */;
/*!40103 SET TIME_ZONE=#OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=#OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=#OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=#OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=#OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=#OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=#OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=#OLD_SQL_NOTES */;
-- Dump completed on 2017-04-24 23:12:19
This is taken from a WHM 11.52 server. It seems that in the latest cPanel/WHM version the database is not there anymore. I suggest you open a support ticket to cPanel and ask.
Meanwhile you can create the database from the table structure I have provided. Not sure if exim will log anything into it though since if they removed the database then the exim configuration could have changed and this could lead in no logging to the database.
Related
Extension installation prefill table
Hi I want to add some data during extension installation ... I've added an SQL statement after table creation but that will be ignored during installation. # # Insert für start einstellungen # INSERT INTO tx_rere_domain_model_intervall (type,aktuell) VALUES ('studienhalbjahr','WS14/15'); This code is directly after the Create Statement of tx_rere_domain_model_intervall UPDATE: # TYPO3 Extension Manager dump 1.1 # #-------------------------------------------------------- # # Table structure for table 'tx_rere_domain_model_interval' # DROP TABLE IF EXISTS tx_rere_domain_model_intervall; CREATE TABLE tx_rere_domain_model_intervall ( uid int(11) NOT NULL auto_increment, pid int(11) DEFAULT '0' NOT NULL, type varchar(255) DEFAULT '' NOT NULL, aktuell varchar(255) DEFAULT '' NOT NULL, tstamp int(11) unsigned DEFAULT '0' NOT NULL, crdate int(11) unsigned DEFAULT '0' NOT NULL, cruser_id int(11) unsigned DEFAULT '0' NOT NULL, deleted tinyint(4) unsigned DEFAULT '0' NOT NULL, hidden tinyint(4) unsigned DEFAULT '0' NOT NULL, starttime int(11) unsigned DEFAULT '0' NOT NULL, endtime int(11) unsigned DEFAULT '0' NOT NULL, t3ver_oid int(11) DEFAULT '0' NOT NULL, t3ver_id int(11) DEFAULT '0' NOT NULL, t3ver_wsid int(11) DEFAULT '0' NOT NULL, t3ver_label varchar(255) DEFAULT '' NOT NULL, t3ver_state tinyint(4) DEFAULT '0' NOT NULL, t3ver_stage int(11) DEFAULT '0' NOT NULL, t3ver_count int(11) DEFAULT '0' NOT NULL, t3ver_tstamp int(11) DEFAULT '0' NOT NULL, t3ver_move_id int(11) DEFAULT '0' NOT NULL, sys_language_uid int(11) DEFAULT '0' NOT NULL, l10n_parent int(11) DEFAULT '0' NOT NULL, l10n_diffsource mediumblob, PRIMARY KEY (uid), KEY parent (pid), KEY t3ver_oid (t3ver_oid,t3ver_wsid), KEY language (l10n_parent,sys_language_uid) ); INSERT INTO tx_rere_domain_model_intervall (type,aktuell) VALUES ('studienhalbjahr','WS14/15');
To include static data with your extension, you must place the SQL INSERT statements in a file named ext_tables_static+adt.sql, which should be located in the root directory of your extension. The content of this file will be imported to the TYPO3 Database when importing the extension with the extension manager. For a working example please refer to the static_info_tables extension.
For me the ext_tables_static+adt.sql dosn't work ... I've done a workarround with prefilling the table if the table is empty!
When working with ext_tables_static+adt.sql, remember to delete the row for your plugin in the table sys_registry if the import doesn't work. Typo3 sets a flag after the import has been done once and future imports will be ignored.
Base table or view not found: 1146 Table magento
When I try to create an admin_user table on the server I get this error: Base table or view not found: 1146 Table The DDL: CREATE TABLE IF NOT EXISTS `admin_user` ( `user_id` mediumint(9) unsigned NOT NULL AUTO_INCREMENT, `firstname` varchar(32) NOT NULL DEFAULT '', `lastname` varchar(32) NOT NULL DEFAULT '', `email` varchar(128) NOT NULL DEFAULT '', `username` varchar(40) NOT NULL DEFAULT '', `password` varchar(40) NOT NULL DEFAULT '', `created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `modified` datetime DEFAULT NULL, `logdate` datetime DEFAULT NULL, `lognum` smallint(5) unsigned NOT NULL DEFAULT '0', `reload_acl_flag` tinyint(1) NOT NULL DEFAULT '0', `is_active` tinyint(1) NOT NULL DEFAULT '1', `extra` text, PRIMARY KEY (`user_id`), UNIQUE KEY `UNQ_ADMIN_USER_USERNAME` (`username`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; What is wrong?
Default charset in Typo3 ext_tables.sql
I use typo3 sql parser for creating tables. I want to create tables with default charset, but if I set default charset in my query: CREATE TABLE `table1` ( `col1` varchar(64) NOT NULL DEFAULT '', `col2` varchar(64) NOT NULL DEFAULT '', `col3` text NOT NULL, PRIMARY KEY (`col1`,`col2`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; parser returns CREATE TABLE table1 ( col1 varchar(64) NOT NULL default '', col2 varchar(64) NOT NULL default '', col3 text NOT NULL, PRIMARY KEY (col1,col2) ) ENGINE=InnoDB; How to set default charset?
I guess it is not implemented in TYPO3 SQL Parser. But IMHO there is no need to. You should just use the DEFAULT CHARSET which is set for the DB. This should be UTF8 anyway, since TYPO3 does not support other charsets anymore (AFAIK).
ERROR 1064 (42000) while importing .sql file into MySQL
I'm trying to import a client's database dump into my MySQL 5.5.27 (for Win64) running on Windows Vista 64 bit. However, I get ERROR 1064 (42000) at line 24: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '*/' at line 8 I've pasted the first several lines of the dump file below: CREATE DATABASE IF NOT EXISTS `foobar` /*!40100 DEFAULT CHARACTER SET utf8 */; USE `foobar`; -- MySQL dump 10.13 Distrib 5.5.16, for osx10.5 (i386) -- -- Host: localhost Database: foobar -- ------------------------------------------------------ -- Server version 5.5.21 /*!40101 SET #OLD_CHARACTER_SET_CLIENT=##CHARACTER_SET_CLIENT */; /*!40101 SET #OLD_CHARACTER_SET_RESULTS=##CHARACTER_SET_RESULTS */; /*!40101 SET #OLD_COLLATION_CONNECTION=##COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; /*!40103 SET #OLD_TIME_ZONE=##TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET #OLD_UNIQUE_CHECKS=##UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET #OLD_FOREIGN_KEY_CHECKS=##FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET #OLD_SQL_MODE=##SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET #OLD_SQL_NOTES=##SQL_NOTES, SQL_NOTES=0 */; -- -- Temporary table structure for view `reference` -- CREATE TABLE `reference` ( `xyz` varchar(50), `ABC` varchar(50), `asdf` varchar(50), `abcd` varchar(7), `Axe` varchar(255), `Age` varchar(255) ) ENGINE=MyISAM */; SET character_set_client = #saved_cs_client;
Try to change the script in this way - ... CREATE TABLE `reference` ( `xyz` varchar(50), `ABC` varchar(50), `asdf` varchar(50), `abcd` varchar(7), `Axe` varchar(255), `Age` varchar(255) ) ENGINE=MyISAM */; SET character_set_client = #saved_cs_client;*/ or just remove that part - ... CREATE TABLE `reference` ( `xyz` varchar(50), `ABC` varchar(50), `asdf` varchar(50), `abcd` varchar(7), `Axe` varchar(255), `Age` varchar(255) );
Multi-table query - get friend updates
SELECT M.msg_id, M.uid_fk, M.message, M.created, U.fname, U.lname, M.uploads FROM messages M, users_friends F, users U WHERE M.uid_fk=F.friendID and F.userID = '5' and status='2' Building a facebook-like wall and want to grab messages(updates) from friends. The query above returns an empty set, even though I've made sure there are messages from user 5 in the table. Schema: CREATE TABLE IF NOT EXISTS `messages` ( `msg_id` int(11) NOT NULL AUTO_INCREMENT, `message` varchar(200) CHARACTER SET utf8 DEFAULT NULL, `uid_fk` int(11) DEFAULT NULL, `ip` varchar(30) DEFAULT NULL, `created` int(11) DEFAULT '1269249260', `uploads` varchar(30) DEFAULT NULL, PRIMARY KEY (`msg_id`), KEY `uid_fk` (`uid_fk`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=263 ; CREATE TABLE IF NOT EXISTS `users` ( `fname` varchar(15) NOT NULL, `lname` varchar(15) NOT NULL, `userID` int(11) NOT NULL AUTO_INCREMENT, `username` varchar(23) NOT NULL, `email` varchar(50) NOT NULL, `password` varchar(32) NOT NULL, `DOB` date DEFAULT NULL, `sex` varchar(1) DEFAULT NULL, `about` text NOT NULL, `location` varchar(20) DEFAULT NULL, `last_login` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `user_level` int(11) NOT NULL DEFAULT '0', `profile_image` varchar(200) NOT NULL, `profile_image_small` varchar(200) NOT NULL, PRIMARY KEY (`userID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=19 ; CREATE TABLE IF NOT EXISTS `users_friends` ( `userID` int(11) NOT NULL, `friendID` int(11) NOT NULL, `status` int(1) NOT NULL DEFAULT '0', PRIMARY KEY (`userID`,`friendID`), KEY `fk_users_has_friends_users1` (`userID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
You are single quoting your INT values in the WHERE clause → '5' & '2'. Also, try JOINs. SELECT M.msg_id, M.uid_fk, M.message, M.created, U.fname, U.lname, M.uploads FROM messages M INNER JOIN users_friends F ON F.friendID = M.uid_fk AND F.userID = 5 AND F.status = 2 INNER JOIN users U ON U.userID = F.friendID;