PDA

View Full Version : Table Crashed?


Ubbe
12-01-2008, 12:46 PM
Hi everybody, today when I entered my pixelpost blog I got this:

"Table './ubbedall_dk/blog_visitors' is marked as crashed and should be repaired"

I haven't made any alterations to my mysql database or my pixelpost installation / directory so I have no idea what caused this, anyhow, how do I fix this? :S

jaywilliams
12-01-2008, 02:32 PM
Do you have access to phpMyAdmin? If so, executing this SQL code, should do the trick:

Warning! Please backup your entire database before trying this code!
Do you have access to phpMyAdmin? If so, executing this SQL code, should do the trick:


--
-- Backup old visitors table
--
RENAME TABLE `blog_visitors` TO `blog_visitors_backup` ;

--
-- Table structure for table `pixelpost_visitors`
--
DROP TABLE IF EXISTS `blog_visitors`;
CREATE TABLE `blog_visitors` (
`id` int(11) NOT NULL auto_increment,
`datetime` datetime NOT NULL default '0000-00-00 00:00:00',
`host` varchar(100) NOT NULL default '',
`referer` varchar(255) NOT NULL default '',
`ua` varchar(255) NOT NULL default '',
`ip` varchar(255) NOT NULL default '',
`ruri` varchar(150) NOT NULL default '',
PRIMARY KEY (`id`),
KEY `datetime` (`datetime`),
KEY `referer` (`referer`),
KEY `ip` (`ip`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

Ubbe
12-01-2008, 04:37 PM
Thanks jay I didn't try it yet, but shouldn't

--
-- Table structure for table `pixelpost_visitors`
--

Be this instead:

--
-- Table structure for table `blog_visitors`
--

??? I don't really have much experience with MySQL, just thought it seemed like a typo?

jaywilliams
12-01-2008, 05:10 PM
With MySQL, any text after "---" is considered a comment. Similar to HTML's <!-- --> and PHP's // or #.

To answer your question, no, it won't cause any issues either way.

Ubbe
12-01-2008, 10:47 PM
Ah okay, I didn't know :) well thanks I'll try it now.

EDIT: It's working now thank you very much Jay :)