By admin on Sun, 11/17/2024 - 16:27
As a Drupal developer or site administrator, you might encounter this error message when migrating a Drupal site to a new server.
Got error 'PHP message: Error: Class "Drupal\\mysql\\Driver\\Database\\mysql\\Connection" not found in public_html/core/lib/Drupal/Core/Database/Database.php
So, how can you resolve this? In this blog post, we will explore how to fix it.
Step #1
Change file and folder permission to make settings.php file writable. Apply following permission.
- /sites/default 755
- /sites/default/settings.php 644
Step #2
Open settings.php in text editor.
- Check and make sure these are correct: database name, database username, database password.
- Check namespace line. It should be like this:
'namespace' => 'Drupal\\mysql\\Driver\\Database\\mysql',
'autoload' => 'core/modules/mysql/src/Driver/Database/mysql/',
Save the file after editing.
Step #3
Check your website, it should be fixed now. You should now revert the file and folder permission to default.
- /sites/default 555
- /sites/default/settings.php 444
Category:
- admin's blog
- Log in or register to post comments