0

I am attempting to install Magento 2 on my server. Everything is set up following the guides online but when I go to install the software it stops at 51% and gives me the following error in the console:

[ERROR] PDOException: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`me_magento`.`cms_page`, CONSTRAINT `CMS_PAGE_PAGE_ID_SEQUENCE_CMS_PAGE_SEQUENCE_VALUE` FOREIGN KEY (`page_id`) REFERENCES `sequence_cms_page` (`sequence_value`) ON DELETE CASCADE)

This is followed but other PDO errors. I have tried deleting all tables from the database and installing again but I get the same results. I know there isnt an error with PDO as I use it for all my websites when interacting with MySQL. Any help on how I can get this resolved and get Magento 2 installed would be great.

Thanks!

EDIT:

I tried installing the version without the sample data and I get this error:

[ERROR] LogicException: Unknown module in the requested list: 'Magento_CatalogRuleSampleData' in /public_html/magento/setup/src/Magento/Setup/Model/Installer.php:431
Stack trace:
#0 /public_html/magento/setup/src/Magento/Setup/Model/Installer.php(390): Magento\Setup\Model\Installer->readListOfModules(Array, Array, 'enable_modules')
#1 /public_html/magento/setup/src/Magento/Setup/Model/Installer.php(336): Magento\Setup\Model\Installer->createModulesConfig(Array, true)
#2 /public_html/magento/setup/src/Magento/Setup/Controller/Install.php(109): Magento\Setup\Model\Installer->install(Array)
#3 /public_html/magento/vendor/zendframework/zend-mvc/src/Controller/AbstractActionController.php(82): Magento\Setup\Controller\Install->startAction()
#4 [internal function]: Zend\Mvc\Controller\AbstractActionController->onDispatch(Object(Zend\Mvc\MvcEvent))
#5 /public_html/magento/vendor/zendframework/zend-eventmanager/src/EventManager.php(444): call_user_func(Array, Object(Zend\Mvc\MvcEvent))
#6 /public_html/magento/vendor/zendframework/zend-eventmanager/src/EventManager.php(205): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#7 /public_html/magento/vendor/zendframework/zend-mvc/src/Controller/AbstractController.php(118): Zend\EventManager\EventManager->trigger('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#8 /public_html/magento/vendor/zendframework/zend-mvc/src/DispatchListener.php(93): Zend\Mvc\Controller\AbstractController->dispatch(Object(Zend\Http\PhpEnvironment\Request), Object(Zend\Http\PhpEnvironment\Response))
#9 [internal function]: Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent))
#10 /public_html/magento/vendor/zendframework/zend-eventmanager/src/EventManager.php(444): call_user_func(Array, Object(Zend\Mvc\MvcEvent))
#11 /public_html/magento/vendor/zendframework/zend-eventmanager/src/EventManager.php(205): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#12 /public_html/magento/vendor/zendframework/zend-mvc/src/Application.php(314): Zend\EventManager\EventManager->trigger('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#13 /public_html/magento/setup/index.php(31): Zend\Mvc\Application->run()
#14 {main}

in the console log at 0% so even worse. I can not find the my.cnf file looking in the /ect/ folder so if that is needed to figure out my issue then I will need help finding that.

EDIT 2:

Here is the info in my.cnf:

# The MySQL server
[mysqld]
performance_schema=0
#innodb_force_recovery = 1
port=3306
socket="/tmp/mysql.sock"
key_buffer_size=64M
max_allowed_packet=268435456
bulk_insert_buffer_size=64M
table_open_cache=32768
open_files_limit=65536
sort_buffer_size=8M
 read_buffer_size=2M
read_rnd_buffer_size=4M
myisam_sort_buffer_size=128M
myisam_max_sort_file_size=10G
thread_cache_size=8
myisam-recover-options = DEFAULT
query_cache_size=256M
query_cache_limit=2M
# Try number of CPU's*2 for thread_concurrency
#thread_concurrency=16
max_connections=100
#max_user_connections = 40
max_delayed_threads=0
log-error="/var/log/mysql.error.log"
log-warnings
ft_min_word_len=3
wait_timeout=300
tmp_table_size=512M
max_heap_table_size=512M
table_definition_cache=12000
join_buffer_size=256K
  • You tried to install fresh version? – Khoa TruongDinh Jan 20 '17 at 16:41
  • I downloaded the zip of Magento 2 directly from Magento, the enterprise edition – Action Coding Jan 20 '17 at 16:47
  • Are you still having this issue or have you moved on? Our host changed our max_allowed_packet to 32M and resolved the situation. They also had increased our open_files_limit to what you currently have – Navarr Feb 13 '17 at 15:15
  • have you used with new database ? – Ayush Apr 27 '18 at 13:01
0

what version of mysql are you using? also post here your my.cnf

it would be helpfull if you can get a magento2 standard .sql dump and try to import it via CLI on your server.

  • MySQL is 5.6.34 – Action Coding Jan 21 '17 at 14:48
  • What about my.cnf? It's your problem so try to give us more details – Simone Fantini Jan 21 '17 at 14:52
  • See my edit to my original post – Action Coding Jan 21 '17 at 18:20
  • I still do not see the my.cnf file. Do you know where is it? Tipically /etc/mysql/my.cnf – Simone Fantini Jan 21 '17 at 18:21
  • There is no mysql folder in my /etc/ file so I do not know where else to find it. In my edit above i stated that I can not find the file so I am not sure why you put "I still do not see the my.cnf file" – Action Coding Jan 21 '17 at 18:29
0

What are your server specs? Those specs are for a heavy duty highend mysql server with at lease 32gb ram...

Just try with a default mariadb or percona ...with zero modification

  • Do you have any idea what the issue I am getting in my original question is being caused by? Also, I use mysql for basically any site I build that needs a database so I am good as far as that goes. I just have never used Magento and am trying to get it installed so I can go through the Magento 2 training – Action Coding Jan 23 '17 at 14:52
  • Fundamentally, the sql file youre tring to import has an issue with FK. Most of the time becouse the first dump has been made without --triggers --events..but in this case, starting from a m2 default, are you using yhr git magento or the magento.com/download versione? – Simone Fantini Jan 23 '17 at 15:03
  • Downloaded directly from Magento – Action Coding Jan 23 '17 at 16:18
0

It happens because MySQL often use MyISAM as default engine for tables. But this engine doesn't support foreign keys. So, to fix your error you need to execute following query in MySQL:

SET GLOBAL default_storage_engine=INNODB;

Then delete your database and try to install it again.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.