TransWikia.com

Failed to Read Session Data After Renaming DB

Joomla Asked on September 5, 2021

Joomla 3.9.11

Working on localhost, today I decided to rename my database from dbtest to dbnew. I did this using HeidiSQL > rename db

When I visit my site I now see the following error;

Warning: session_start(): Failed to read session data: user (path:
C:xampptmp) in
C:xampphtdocsmysitelibrariesjoomlasessionhandlernative.php on
line 260 Error: Failed to start application: Failed to start the
session

I opened configuration.php and replaced all instances of dbtest with ‘dbnew’ but same thing.

I’ve also emptied the db sessions table, tried a different browser and restarted apache / mysql.

If I revert the name back to dbtest and change my configuration.php accordingly all works as expected. SO, what am I doing wrong, how can I change my db name correctly?

Any advice?

2 Answers

Found the answer.

When I renamed the database I also had to re-assign the database user to this database.

Correct answer by jonboy on September 5, 2021

First check your session handler in configuration.php and try to set it to 'none'.

$session_handler = 'none';

That should work in most cases and you might get some information on the true causes of the failure.

In my case, the $session_handler was set to 'database' and I had an error in my database setup. If this applies to you as well, check your database setup carefully again (host, db, user & password).

Answered by SvenT on September 5, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP