简体   繁体   English

TYPO3无法写入MySQL数据库

[英]TYPO3 fails to write to MySQL database

TYPO3 fails to insert data in its own tables after installation, but doesn't complain about it, eg the admin user creation via Install Tool finishes with User created! TYPO3在安装后无法在其自己的表中插入数据,但没有抱怨,例如,通过安装工具创建的admin用户完成了User created! , but the be_users table stays empty. ,但be_users表保持为空。

The server is using: 服务器正在使用:

  • Debian 6.0.6 Debian 6.0.6
  • TYPO3 6.0.2 TYPO3 6.0.2
  • PHP Version 5.3.19-1~dotdeb.0 PHP版本5.3.19-1〜dotdeb.0
  • mysql Ver 14.14 Distrib 5.5.28 mysql版本14.14 Distrib 5.5.28

Edit: What I've tried so far: 编辑:到目前为止,我已经尝试过:

1. Inserts with MySQL Workbench and the typo3 database user are working. 1.带有MySQL Workbench的插入和typo3数据库用户正在工作。 Grants: 补助金:

GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, TRIGGER ON `typo3`.* TO 'typo3_user'@'localhost'

2. I experimeneted with the commit behaviour and added two lines to the Installer.php , but without success: 2.我体验了commit行为,并向Installer.php添加了两行,但没有成功:

// added
$autoCommitOffResult = $GLOBALS['TYPO3_DB']->sql_query('SET SESSION autocommit = 0;');

// the original non-working insert
$result = $GLOBALS['TYPO3_DB']->exec_INSERTquery('be_users', $insertFields);

// added
$GLOBALS['TYPO3_DB']->sql_query('commit;');

3. I removed the strict sql_mode . 3.我删除了严格的sql_mode

4. Another Typo3 installation on a very similar server succeeded. 4.在非常相似的服务器上成功进行了另一个Typo3安装。

Any further suggestions? 还有其他建议吗?

Try the following around the line which doesn't work (2 lines before, 4 lines below): 在无效的行周围尝试以下操作(之前2行,下面4行):

$GLOBALS['TYPO3_DB']->debugOutput = true;
$GLOBALS['TYPO3_DB']->store_lastBuiltQuery = true;

// Now the line which should insert the BE User:
// the original non-working insert
$result = $GLOBALS['TYPO3_DB']->exec_INSERTquery('be_users', $insertFields);

// Now print out the "insert_id" (uid autoincrement value) and query which has been executed:
echo $GLOBALS['TYPO3_DB']->sql_insert_id();
echo "<br />\n";
echo $GLOBALS['TYPO3_DB']->debug_lastBuiltQuery;
exit();

Then try to copy&paste this query to the mysql shell. 然后尝试将此查询复制并粘贴到mysql shell。 As with any problem make sure you use the same server, database, etc. 遇到任何问题时,请确保使用相同的服务器,数据库等。

The exit takes care that no other code will remove the new user directly after creation. 退出时要确保没有其他代码会在创建后直接删除新用户。

您要commit交易吗?

The default engine of MySQL is InnoDB. MySQL的默认引擎是InnoDB。 Changing the engine for the Typo3 tables to MyISAM fixes the problem: 将Typo3表的引擎更改为MyISAM可以解决此问题:

ALTER TABLE be_users ENGINE = MyISAM;
...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM