'Wordpress Multisite installation issue on staging website

I am trying to change my website into multisite on my staging server.
When I add define('MULTISITE', true); in wp-config.php on my local machine setup, it works fine. Then I go to the Network admin and able to setup multiple sites. I add further code in .htaccess and wp-config.php.

But when I add define('MULTISITE', true); in wp-config.php on my staging site and refresh the page it show me the database connection error. I checked the database and I saw that it is not creating the required tables like, wp_blogs, wp_blogsmeta, wp_site, etc.
I tried to setup by adding the missing tables manually, but still it is showing the same error.

enter image description here enter image description here

I checked my database credentials, everything is fine.

What should I do? Thanks in advance.



Solution 1:[1]

It was a silly mistake done by me.
For those who don't know:

  1. Firstly you need to define this in wp-config.php: define('WP_ALLOW_MULTISITE', true);
  2. Then disable all your plugins.
  3. Then Go to the Dashboard > Tools > Network Setup
  4. Then choose if you want to create subdomain or the sub-directory(for localhost you can just create sub-directory).
  5. Enter the Network Title and Network Admin Email and click on Install button.
  6. Then copy the codes of wp-config.php and .htaccess and paste to the respective files.

    and it's done.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1