I have installed a forum module for SS. I'm currently using version 2.3.3
After I installed the forum file on the back end I receive a message that says “File not found” on Firefox, and “This webpage is not found” on Google Chrome.
I followed all the instructions but I still get the error message.
Also, when I run http://mysite.co.za/dev/build/?flush=1, I receive this error message
>[User Error]
Couldn't run query:
CREATE TABLE `ForumCategory` (
`ID` int(11) not null auto_increment,
`ClassName` enum('ForumCategory') character set utf8 collate utf8_general_ci default 'ForumCategory',
`Created` datetime,
`LastEdited` datetime,
`Title` varchar(100) character set utf8 collate utf8_general_ci,
`StackableOrder` varchar(2) character set utf8 collate utf8_general_ci,
`ForumHolderID` int(11) not null default '0',
index `ForumHolderID` (ForumHolderID),
index `ClassName` (ClassName), primary key (ID) ) TYPE=MyISAM
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 'TYPE=MyISAM' at line 14
GET /dev/build/flush=1
Line 401 in /home/neutrog7/public_html/sapphire/core/model/MySQLDatabase.php"
Your best bet is to upgrade to a newer version of SilverStripe. I'd recommend upgrading to 3.0 if you can, but if it becomes too much effort to upgrade to 3.0 then try 2.4.
If you really can't upgrade at this stage, you'll need to replace "TYPE" with "ENGINE" in MySQLDatabase.php. But, really, you're going to be mostly on your own if you go down this path and upgrading would be much better.
Related
I run into an SQL query error.
The query:
CREATE TABLE IF NOT EXISTS `shoutbox` (
`id` int(255) NOT NULL AUTO_INCREMENT,
`user` varchar(255) NOT NULL,
`msg` varchar(255) NOT NULL,
`time` datetime(6) DEFAULT NOT NULL CURRENT_TIMESTAMP(6),
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
MySQL said:
#1064 - 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
'(6) DEFAULT NOT NULL CURRENT_TIMESTAMP(6),
PRIMARY KEY (`id`)
) ENGINE=MyISAM ' at line 5
Since this looks like your first import.
MySQL reference manuals are per the link. As you can see 5.5 is so old its in a PDF version only.
Since you are importing a sql file, look closer at the text of it, it will say what version it came from. The first step should be to install the same major version of mysql (the first two digits like 5.7 or 8.0). If the last digit is later than the origin sql that's fine.
Don't start with 5.5, its too old. Consider a minimum of 5.7 first or 8.0 if the version of the sql dump is later.
Default keyword should be before the default value
`time` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6),
assuming the posted code has been transcribed accurately this amendment fixes the posted error...
AND what's the point of not null AND a default?
I have this error when importing a database on my phpMyAdmin and from research the solution is to change the keyword TYPE to ENGINE. TYPE has been updated to ENGINE.
How can I make the changes on phpMyAdmin?
CREATE TABLE IF NOT EXISTS `wpf8_commentmeta` (
`meta_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`comment_id` bigint(20) unsigned NOT NULL DEFAULT '0',
`meta_key` varchar(255) DEFAULT NULL,
`meta_value` longtext,
PRIMARY KEY (`meta_id`),
KEY `comment_id` (`comment_id`),
KEY `meta_key` (`meta_key`(191))
) TYPE=MyISAM AUTO_INCREMENT=96 ;
MySQL said: Documentation
#1064 - 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 'TYPE=MyISAM AUTO_INCREMENT=96' at line 19
TYPE was deprecated in MySQL 4.0 and removed in MySQL 5.5. When upgrading to MySQL 5.5 or later, you must convert existing applications that rely on TYPE to use ENGINE instead.
You can see the current version of the documentation here: https://dev.mysql.com/doc/refman/5.7/en/create-table.html
MySQL 4.0 was released sometime in 2003-2004 and if your version of phpmyadmin uses it, it is extremely old. Update phpmyadmin to the current version and it will solve your issue.
Designed Database and Table in Local Server Using MySQL 5.6.17 and Export into *.sql file.
When try to Import *.sql file into Live Server(MySQL 5.1.36) got below Error:
#1293 - Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause
Understood the issue through this link
Is there any way to import Local Server's *.sql file to Live Server without Updating MySQL Version?
TABLE:
CREATE TABLE 'currency' (
'id' int(11) NOT NULL AUTO_INCREMENT,
'currency_name' varchar(30) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT
NULL,
'country' varchar(20) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
'currency' varchar(5) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
'created_by' int(11) NOT NULL,
'created_on' timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
'status' int(1) NOT NULL DEFAULT '1',
'modified_by' int(11) DEFAULT NULL,
'modified_on' timestamp NOT NULL ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY ('id')) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8;
NOTE:- Windows Server Running WAMP(Local Server) and QNAP(Live Server).
There is not a direct way to do it, since this is not a valid table definition for any version prior to MySQL Server 5.6.5.
You could edit the dump file by hand or with a tool like sed or perl to modify the offending lines, or you could change the table definition on the source server... but then your application, which presumably expects this behavior, isn't going to work properly.
You could also modify the table definition to make it valid for 5.1, with only one automatic timestamp, and use triggers to get the rest of the desired behavior.
The best course, of course, is one of these:
update the 5.1 server to 5.5 and then to 5.6, or
when developing for a 5.1 server, always use 5.1 in the development environment, so you don't get into conditions like this, relying on newer features that aren't compatible with older deployments... remembering, though, that there are some pretty significant improvements that happened in version 5.6.
Absolutely cannot get rid of these errors in phpmyadmin Version information: 4.2.11
$cfg['Servers'][$i]['users'] ... not OK [ Documentation ]
$cfg['Servers'][$i]['usergroups'] ... not OK [ Documentation ]
Configurable menus: Disabled
$cfg['Servers'][$i]['navigationhiding'] ... not OK [ Documentation ]
Hide/show navigation items: Disabled
$cfg['Servers'][$i]['savedsearches'] ... not OK [ Documentation ]
Saving Query-By-Example searches: Disabled
I have tried the following:
ran SQL
CREATE TABLE IF NOT EXISTS `pma_users` (
`username` varchar(64) NOT NULL,
`usergroup` varchar(64) NOT NULL,
PRIMARY KEY (`username`,`usergroup`)
)
COMMENT='Users and their assignments to user groups'
DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
CREATE TABLE IF NOT EXISTS `pma_usergroups` (
`usergroup` varchar(64) NOT NULL,
`tab` varchar(64) NOT NULL,
`allowed` enum('Y','N') NOT NULL DEFAULT 'N',
PRIMARY KEY (`usergroup`,`tab`,`allowed`)
)
COMMENT='User groups with configured menu items'
DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
CREATE TABLE IF NOT EXISTS `pma_navigationhiding` (
`username` varchar(64) NOT NULL,
`item_name` varchar(64) NOT NULL,
`item_type` varchar(64) NOT NULL,
`db_name` varchar(64) NOT NULL,
`table_name` varchar(64) NOT NULL,
PRIMARY KEY (`username`,`item_name`,`item_type`,`db_name`,`table_name`)
)
COMMENT='Hidden items of navigation tree'
DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
Then updated my config.inc.php with
$cfg['Servers'][$i]['users'] = 'pma_users';
$cfg['Servers'][$i]['usergroups'] = 'pma_usergroups';
$cfg['Servers'][$i]['navigationhiding'] = 'pma_navigationhiding';
Then flushed table caches and restarted phpMyAdmin. The tables for pma_users and uaergroups have been created, but I still get the errors.
PLEASE HELP! This is causing serious issues with my drupal functionality.
Note, I have not yet set root or pma_user passwords.
Ultimately my solution to this problem was to move away from XAMPP local hosting. I moved my site files to remote server, and installed my database and imported my database to their phpyadmin without any issue. Site is now connecting and working beautifully. Spending countless hours following every post I could find and referring to the phpmyadmin documentation were to no avail as opposed to just abandoning ship and going with potentially a more novice user like myself. This worked for me because the remote hosting option was a viable. Unfortunately this answer is not helpful to those whom still need local hosting environment and are using XAMPP. I have the Aquia Dev Desktop that included XAMPP with great success in the past and maybe good option some.
I worked on a site locally through my Laptop. I have a table named blog and it has the fields post_id, title, markdown, author, added, and modified.
The fields Added and Modified are both DATETIME's.
When a user makes a blog post, PHP runs this query successfully: INSERT INTO blog (title, author, markdown, added) VALUES ('BLA', 'BLA', 'BLA', NOW())
I've gone into phpMyAdmin and ran the exact same query with working results.
Now, I exported my exact database into the server today and I noticed that no posts were being stored in the DB, so I tried running it through phpMyAdmin's SQL and it gave me the error Field 'modified' doesn't have a default value.
Why would this be happening? In my database, the default for both is None so I'm quite confused on what could be causing this.
My Laptop has PHP 5.3.1 and MySQL 5.1.41 (I installed XAMPP.)
The Server has PHP 5.3.5 and MySQL 5.5.8 (Out of desperation I installed the newest versions. The server was originally running MySQL 5.1 and a lower version of PHP.)
This has been killing me, hopefully someone knows what's wrong with this or how to fix it.
Edit: Here are the SHOW CREATE TABLE blog results.
Laptop:
| blog | CREATE TABLE `blog` (
`post_id` mediumint(9) NOT NULL AUTO_INCREMENT,
`title` varchar(160) NOT NULL,
`author` varchar(100) NOT NULL,
`markdown` longtext NOT NULL,
`added` datetime NOT NULL,
`modified` datetime NOT NULL,
PRIMARY KEY (`post_id`)
) ENGINE=MyISAM AUTO_INCREMENT=7 DEFAULT CHARSET=latin1 |
Server:
| blog | CREATE TABLE `blog` (
`post_id` mediumint(9) NOT NULL AUTO_INCREMENT,
`title` varchar(160) NOT NULL,
`author` varchar(100) NOT NULL,
`markdown` longtext NOT NULL,
`added` datetime NOT NULL,
`modified` datetime NOT NULL,
PRIMARY KEY (`post_id`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1 |
Auto Increments are different because of my tests.
ALTER TABLE blog CHANGE modified modified TIMESTAMP DEFAULT CURRENT_TIMESTAMP;
Or, more rarely, you might have a buggy version of MySQL on your server.
*I might have the syntax imperfect, I referred to the last comment on ALTER TABLE at the bottom of the manual page.
First: are you sure the data on your laptop exactly the same as the data on the server? Maybe you're not getting this error on your laptop because the default values are set on your laptop table somehow and not the server -- possibly an issue with how you exported the data.
When you say, the default is "None" do you mean NULL or do you mean literally the word "None"?
If both fields are datetime fields, then set the default to NOW() or, if you prefer to not have an actual date and time by default, use a string like "0000-00-00 00:00:00", or the JDBC friendly "0001-01-01 00:00:00".
Compare the structure of each table with the following command in a mysqlclient:
SHOW CREATE TABLE blog;
Dump the DDL from both versions using
$ mysqldump --no-data dabasename
and compare them (and check the man page for mysqldump(1) as I'm flying by memory here.)
Make sure you're using the same exact table description and that both versions are using the same engine.