MyBB Community Forums

Full Version: Attachmentdatabase issues
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
My hosts were giving me hassle about bandwidth issues and while I was looking at solutions I messed up my attachment database. I thought I had figured it out and fixed it but now no one can add attachments, option works but the attachment simple doesnt show up.

Could someone maybe have a look if I supplied admin access? Matt helped me out before
What do you mean you've messed up the attachment database? Did you delete the table or alter the structure or something?
(10-08-2017, 04:07 PM)Wires Wrote: [ -> ]What do you mean you've messed up the attachment database? Did you delete the table or alter the structure or something?

Yeah, I meant to empty it and dropped it instead. Created a new database and it seemed to work but now, nope.
Try the following for the latest version of MyBB:

DROP TABLE IF EXISTS `mybb_attachments`;
CREATE TABLE `mybb_attachments` (
  `aid` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `pid` int(10) unsigned NOT NULL DEFAULT '0',
  `posthash` varchar(50) NOT NULL DEFAULT '',
  `uid` int(10) unsigned NOT NULL DEFAULT '0',
  `filename` varchar(120) NOT NULL DEFAULT '',
  `filetype` varchar(120) NOT NULL DEFAULT '',
  `filesize` int(10) unsigned NOT NULL DEFAULT '0',
  `attachname` varchar(120) NOT NULL DEFAULT '',
  `downloads` int(10) unsigned NOT NULL DEFAULT '0',
  `dateuploaded` int(10) unsigned NOT NULL DEFAULT '0',
  `visible` tinyint(1) NOT NULL DEFAULT '0',
  `thumbnail` varchar(120) NOT NULL DEFAULT '',
  PRIMARY KEY (`aid`),
  KEY `pid` (`pid`,`visible`),
  KEY `uid` (`uid`)
) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
Im sorry, Am I running this somewhere or using the values to create a new database via phpmyadmin?
(10-10-2017, 02:27 PM)ESForum Wrote: [ -> ]Im sorry, Am I running this somewhere or using the values to create a new database via phpmyadmin?

Run the above as a query in your current database via PhpMyAdmin.
ran that I think but no difference

In my orphanat attachments it says "Not in attachments table" as the reason for being orphaned
This only create a new table for your attachments but not link to the old one... this will be hard work to restore this manualy if you don't have backups.
I dont have anything in there, I dont have any attachments so creating a new tables fine once poeple can start adding attachments again afterwards
Then you are lucky Wink... dont forget to make constantly backups.. specialy before you try something out or change something or install something.... ever ever ever make a backup befor.
Pages: 1 2