Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

SQL Exception during clean installation of a version 0.7.14800
 
Garri
Jr. Member
 
Avatar
Total Posts:  30
Joined:  2007-09-18
 

PDOException Object
(
[message:protected] => SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name ‘type’
[string:private] =>
[code:protected] => 42S21
[file:protected] => D:\WebProjects\magentocommerce_dev\lib\Varien\Db\Adapter\Pdo\Mysql.php
[line:protected] => 106
[trace:private] => Array
(
[0] => Array
(
[file] => D:\WebProjects\magentocommerce_dev\lib\Varien\Db\Adapter\Pdo\Mysql.php
[line] => 106
[function] => query
[class] => PDO
[type] => ->
[args] => Array
(
[0] =>

ALTER TABLE `core_url_rewrite`
ADD COLUMN `type` int(1) NOT NULL DEFAULT ‘0’ after `options`,
ADD COLUMN `description` varchar(255) NULL after `type`;

DELETE FROM `core_config_data` WHERE `path`=’payment/authorizenet/cgi_url’;

)

)

[1] => Array

......

 
Magento Community Magento Community
Magento Community
Magento Community
 
Garri
Jr. Member
 
Avatar
Total Posts:  30
Joined:  2007-09-18
 

Sorry, My mistake. wrong message.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Garri
Jr. Member
 
Avatar
Total Posts:  30
Joined:  2007-09-18
 

MySQL version is 4.1.21
The real message:

PDOException Object
(
    
[message:protected] => SQLSTATE[42000]Syntax error or access violation1231 Variable 'sql_mode' can't be set to the value of 'NULL'
    [string:private] => 
    [code:protected] => 42000
    [file:protected] => D:\WebProjects\magentocommerce_dev\lib\Varien\Db\Adapter\Pdo\Mysql.php
    [line:protected] => 106
    [trace:private] => Array
        (
            [0] => Array
                (
                    [file] => D:\WebProject\magentocommerce_dev\lib\Varien\Db\Adapter\Pdo\Mysql.php
                    [line] => 106
                    [function] => query
                    [class] => PDO
                    [type] => ->
                    [args] => Array
                        (
                            [0] => 
SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
                        )
...
...
exception '
Mage_Core_Exception' with message 'Error in file"D:\WebProjects\magentocommerce_dev\app\code\core\Mage\Core\sql\core_setup\mysql4-install-0.7.0.php" SQLSTATE[42000]Syntax error or access violation1231 Variable 'sql_mode' can't be set to the value of 'NULL'' in D:\WebProjects\magentocommerce_dev\app\Mage.php:363
Stack trace
:
#0 D:\WebProjects\magentocommerce_dev\app\code\core\Mage\Core\Model\Resource\Setup.php(254): Mage::exception('Mage_Core', 'Error in file: ...')
#1 D:\WebProjects\magentocommerce_dev\app\code\core\Mage\Core\Model\Resource\Setup.php(133): Mage_Core_Model_Resource_Setup->_modifyResourceDb('install', '', '0.7.0')
#2 D:\WebProjects\magentocommerce_dev\app\code\core\Mage\Core\Model\Resource\Setup.php(120): Mage_Core_Model_Resource_Setup->_installResourceDb('0.7.0')
#3 D:\WebProjects\magentocommerce_dev\app\code\core\Mage\Core\Model\Resource\Setup.php(94): Mage_Core_Model_Resource_Setup->applyUpdates()
#4 D:\WebProjects\magentocommerce_dev\app\code\core\Mage\Core\Model\Config.php(156): Mage_Core_Model_Resource_Setup::applyAllUpdates()
#5 D:\WebProjects\magentocommerce_dev\app\code\core\Mage\Core\Model\App.php(135): Mage_Core_Model_Config->init(NULL)
#6 D:\WebProjects\magentocommerce_dev\app\Mage.php(390): Mage_Core_Model_App->init('base', NULL)
#7 D:\WebProjects\magentocommerce_dev\app\Mage.php(410): Mage::app('base', NULL)
#8 D:\WebProjects\magentocommerce_dev\index.php(29): Mage::run('base')
#9 {main}
 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1770
Joined:  2007-08-07
Los Angeles
 

interesting, try replacing in app/code/core/Mage/Core/Model/Resource/Setup.php approx line 470:

SET SQL_MODE=IFNULL(@OLD_SQL_MODE,'');
SET FOREIGN_KEY_CHECKS=IFNULL(@OLD_FOREIGN_KEY_CHECKS,0);
 
Magento Community Magento Community
Magento Community
Magento Community
 
Garri
Jr. Member
 
Avatar
Total Posts:  30
Joined:  2007-09-18
 

After adding of previous code with IFNULL(… i received next error message:

Zend_Db_Statement_Exception Object
(
    
[message:protected] => SQLSTATE[HY000]General error2013 Lost connection to MySQL server during query
    [string
:private] => 
    
[code:protected] => 0
    [file
:protected] => D:\WebProjects\magentocommerce_dev\lib\Zend\Db\Statement\Pdo.php
    [line
:protected] => 227
    [trace
:private] => Array
        (
            
[0] => Array
                (
                    
[file] => D:\WebProjects\magentocommerce_dev\lib\Zend\Db\Statement.php
                    [line] 
=> 279
                    [function] 
=> _execute
                    [class] 
=> Zend_Db_Statement_Pdo
                    [type] 
=> ->
                    
[args] => Array
                        (
                            
[0] => Array
                                (
                                    
[0] => quote
                                
)
...
...
exception 'Mage_Core_Exception' with message 'Error in file: "D:\WebProjects\magentocommerce_dev\app\code\core\Mage\Sales\sql\sales_setup\mysql4-install-0.7.0.php" - SQLSTATE[HY000]: General error: 2013 Lost connection to MySQL server during query' in D:\WebProjects\magentocommerce_dev\app\Mage.php:363
Stack trace
:
#0 D:\WebProjects\magentocommerce_dev\app\code\core\Mage\Core\Model\Resource\Setup.php(254): Mage::exception('Mage_Core', 'Error in file: ...')
#1 D:\WebProjects\magentocommerce_dev\app\code\core\Mage\Core\Model\Resource\Setup.php(133): Mage_Core_Model_Resource_Setup->_modifyResourceDb('install', '', '0.7.0')
#2 D:\WebProjects\magentocommerce_dev\app\code\core\Mage\Core\Model\Resource\Setup.php(120): Mage_Core_Model_Resource_Setup->_installResourceDb('0.7.0')
#3 D:\WebProjects\magentocommerce_dev\app\code\core\Mage\Core\Model\Resource\Setup.php(94): Mage_Core_Model_Resource_Setup->applyUpdates()
#4 D:\WebProjects\magentocommerce_dev\app\code\core\Mage\Core\Model\Config.php(156): Mage_Core_Model_Resource_Setup::applyAllUpdates()
#5 D:\WebProjects\magentocommerce_dev\app\code\core\Mage\Core\Model\App.php(135): Mage_Core_Model_Config->init(NULL)
#6 D:\WebProjects\magentocommerce_dev\app\Mage.php(390): Mage_Core_Model_App->init('base', NULL)
#7 D:\WebProjects\magentocommerce_dev\app\Mage.php(410): Mage::app('base', NULL)
#8 D:\WebProjects\magentocommerce_dev\index.php(29): Mage::run('base')
#9 {main}

and now, after commenting of app/code/core/Mage/Core/Model/Resource/Setup.php approx line 253:

catch (Exception $e){
              
//      echo "<pre>".print_r($e,1)."</pre>";
                    
throw Mage::exception('Mage_Core'Mage::helper('core')->__('Error in file: "%s" - %s'$sqlFile$e->getMessage()));
                
}

I received the following message:

Fatal errorCall to a member function getCode() on a non-object in D:\WebProjects\magentocommerce_dev\app\code\core\Mage\Core\Model\Url.php on line 469

Very strange ohh

 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1770
Joined:  2007-08-07
Los Angeles
 

If you delete app/etc/local.xml and re-create the database, does it give the same error?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Garri
Jr. Member
 
Avatar
Total Posts:  30
Joined:  2007-09-18
 

Yes of course, I have already tried many times.
But in the end I decided to fully comments of app/code/core/Mage/Core/Model/Resource/Setup.php lines 253-254

catch (Exception $e){
              
//    echo "<pre>".print_r($e,1)."</pre>";
              //    throw Mage::exception('Mage_Core', Mage::helper('core')->__('Error in file: "%s" - %s', $sqlFile, $e->getMessage()));
                
}
so I was able to reach the end of the installation. But in the processing of testing front- backends I missing some tables smile
Perhaps the time has come long ago to move to the latest version MYSQL as well as the move from Windows to anything else. wink
 
Magento Community Magento Community
Magento Community
Magento Community
 
Garri
Jr. Member
 
Avatar
Total Posts:  30
Joined:  2007-09-18
 

Now everything works. After reinstalling everything. Super.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top