To make the prefix change in this case I have used the Phpmyadmin tool as it allows to make the change quickly.
Once we enter Phpmyadmin we must go to the database of our Drupal.
Once there we must go to the end of said database administrator and select “Mark all”, function that aims to select all the tables in our database
After the selection we go to the collapsible and mark the option “Add prefix to table”, immediately after this action we will be redirected to another page where we will have to enter the prefix we want to use. To finish, we must press the “Send” button.
After we already have our tables with prefixes we must go to the settings.php file of our Drupal installation to make some adjustments.
In version 8 of Drupal we are using the configuration file is located in the default directory that is located within
Once there we have to edit the settings.php file and go to the end of the file where we will find a code like the following, this is where you will find the configuration of the database.
$databases['default']['default'] = array (
'database' => 'drupal',
'username' => 'root',
'password' => '',
'prefix' => '',
'host' => '127.0.0.1',
'port' => '33067',
'namespace' => 'Drupal\\Core\\Database\\Driver\\mysql',
'driver' => 'mysql',
);
In this code we only need to change in the array the value contained in the prefix with the same value that we have entered in our Phpmyadmin.
$databases['default']['default'] = array (
'database' => 'drupal',
'username' => 'root',
'password' => '',
'prefix' => 'site1_',
'host' => '127.0.0.1',
'port' => '33067',
'namespace' => 'Drupal\\Core\\Database\\Driver\\mysql',
'driver' => 'mysql',
);
After this, just save the file and refresh the page of our site in Drupal and confirm that everything works correctly.