Jens Piegsa
Jens Piegsa

Reputation: 7485

TYPO3 fails to write to MySQL database

TYPO3 fails to insert data in its own tables after installation, but doesn't complain about it, e.g. the admin user creation via Install Tool finishes with User created!, but the be_users table stays empty.

The server is using:

Edit: What I've tried so far:

1. Inserts with MySQL Workbench and the typo3 database user are working. 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:

// 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.

4. Another Typo3 installation on a very similar server succeeded.

Any further suggestions?

Upvotes: 0

Views: 3042

Answers (3)

Jens Piegsa
Jens Piegsa

Reputation: 7485

The default engine of MySQL is InnoDB. Changing the engine for the Typo3 tables to MyISAM fixes the problem:

ALTER TABLE be_users ENGINE = MyISAM;
...

Upvotes: 1

kraftb
kraftb

Reputation: 655

Try the following around the line which doesn't work (2 lines before, 4 lines below):

$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. 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.

Upvotes: 4

hd1
hd1

Reputation: 34657

Are you committing the transaction?

Upvotes: 1

Related Questions