Error Establishing A Database Connection Wordpress Multisite
Contents |
tour help Tour Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site wordpress multi site database connection error About Us Learn more about Stack Overflow the company Business Learn more about wordpress multisite move error establishing database connection hiring developers or posting ads with us WordPress Development Questions Tags Users Badges Unanswered Ask Question _ WordPress Development Stack wordpress.org error establishing a database connection Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can wordpress migration error establishing a database connection answer The best answers are voted up and rise to the top DB connection error after copying a WordPress Multisite instance to a second location up vote 6 down vote favorite 4 Here's my setup. I have a Multisite instance running at http://example.com, and I want to do development and staging. Moving an existing Multisite instance of WP onto localhost is a nightmare, so I'm going
Move Wordpress Site Error Establishing A Database Connection
to do dev on a staging location instead. I set up http://staging.example.com to point to the /public_html/staging/ directory of the hosting account, and copied all of the WP files from my root into the /staging/ directory. I also copied the database files (SQL dump, imported the tables into a new database), and changed the wp-config.php file to point to the new database. After running SQL to change the database records, I also change this one line in the wp-config.php file: /** Turning on WordPress MU, new in 3.0 */ define( 'MULTISITE', true ); define( 'SUBDOMAIN_INSTALL', false ); $base = '/'; define( 'DOMAIN_CURRENT_SITE', 'example.com' ); // <- I change this line define( 'PATH_CURRENT_SITE', '/' ); define( 'SITE_ID_CURRENT_SITE', 1 ); define( 'BLOG_ID_CURRENT_SITE', 1 ); Changed to: define( 'DOMAIN_CURRENT_SITE', 'staging.example.com' ); // <- now changed When I load up http://staging.example.com, I get... Error establishing database connection! I've checked and triple checked the username and password, made sure that the user has all privileges on the new staging database, and I've left the DBHOST as 'localhost' (although changing it to staging.example.com didn't help, either). Why would the database connection fail? Anyone? (Thanks for your help in advance.)
enabling multisite "Error establishing a database connection" when enabling multisite notch-1 @notch-1 3 months, 2 weeks ago Hi, i have this strange issue: I enabled the multisite and everything was working fine, then
Wp-admin Database Error
i had to revert back to a backup taken just before enabling it fill in your database connection details (by the plesk panel), and now if i try to enable it again following the same steps, i error establishing a database connection wordpress localhost get the database connection error. It's a subdirectory install, and if i go to mysite.com/wordpress it works fine, but i can't get rid of the error when on mysite.com. Before enabling http://wordpress.stackexchange.com/questions/23327/db-connection-error-after-copying-a-wordpress-multisite-instance-to-a-second-loc the multisite the site was up for few months, giving no problems when accessing it from mysite.com. The second time i enabled the multisite it skipped the part where asks for the network name and other things, i think the restore of the backup didn't erased this informations, and god knows what else… The exact moment when it brokes it's when https://wordpress.org/support/topic/error-establishing-a-database-connection-when-enabling-multisite/ i paste the provided lines in the wp-config.php and .htaccess files and click on "login". suggestions on where to investigate? here is my .htaccess (in the root dir): # BEGIN WordPress
In Get an Account Trouble Logging in? Plugins Themes Videos Support Blog Jobs & Pros About Contact Work with us The Hub Log In Become a member New to the https://premium.wpmudev.org/forums/topic/error-establishing-a-database-connection-with-multisite-configuration community? Start here Home Support Support Forums Plugins & themes Korben00 WPMU DEV Initiate 53 pts 20 pts LEVEL 1 Error establishing a database connection with multisite configuration Hello i have a wordpress (3.1.3) configured to https://www.digitalocean.com/community/questions/error-establishing-a-database-connection-wordpress be multi-site (www.korben.info). The main website and the network interface is working perfectly. But when i add a new website (subdomains like qa.korben.info), i have an error : Error establishing a database connection I don't understand, database connection because, in my wp-config.php, user and password are OK for the database (and the main site is working). I dont understand where is the problem. Can you help me ? Thank you. All General WordPress Plugins & Themes Multisite Features & Feedback Comments 38 Korben00 WPMU DEV Initiate 53 pts 20 pts LEVEL 1 This is exactly the description of my problem (i transform a classic website to MU website and i have error establishing a nginx) but i don't have nginx user and the solution described here doesn't work for me. http://kwatog.com/blog/wordpress/wp-multisite-error-connecting-to-database/ Any idea ? Thank you aecnu WP Unicorn 2,825 pts 19,438 pts LEVEL 29 Greetings Korben00 how are you adding sub domains? When logged into the site under the main domain that you said works normally - do you go to network admin --> sites --> add new site? or are you adding them through a Cpanel? Joe nelnehal The Incredible Code Injector 141 pts 440 pts LEVEL 5 check if your wild card subdomain has been set up in cpanel *.yourwebsite.com. Korben00 WPMU DEV Initiate 53 pts 20 pts LEVEL 1 I setup the wildcard correctly in my dns zone (in cpanel-like) And i added subdomains via admin-> sites -> add new site My configuration is good. I think it's possibly a bug with wordpress ? I remark that when i go to a subdomains/wp-admin, it told me the database need to be repaired. I deactivate all plugins and repair tables, but it change nothing. aecnu WP Unicorn 2,825 pts 19,438 pts LEVEL 29 Greetings Korben00 next I would check my .htaccess file to see if the following lines are within it: # BEGIN WordPress RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] # uploaded files Rewrite
have one accepted answer. Are you sure you want to replace the current answer with this one? Yes, I'm sure. Changed your mind? You previously marked this answer as accepted. Are you sure you want to unaccept it? Yes, I'm sure. Sign Up Log In submit Tutorials Questions Projects Meetups Main Site logo-horizontal DigitalOcean Community Menu Tutorials Questions Projects Meetups Main Site Sign Up Log In submit View All Results By: MarkoRadak Subscribe Subscribed Share 11 Error establishing a database connection (WordPress) May 25, 2014 38.6k views Hi there, I'm having a really hard time figuring this out... My website shows up "Error establishing a database connection" on occasion. This happens about once a day. As soon as I reboot the droplet, the problem's gone. I've tried adding the following 2 lines in my wp-config file, as suggested on some other forums, but it didn't work: define('WP_MEMORY_LIMIT', '64M'); define('WP_ALLOW_REPAIR', true); From what I read around the web, it seems that 512mb of RAM is perfectly fine for a wordpress multisite, if set correctly - though I'm having a hard time with a single (low content) site, without many plugins. I've also disabled/deleted the plugins that could potentially eat up a lot of memory, such as wp-backup. If you have any suggestions for me, I'd be more than thankful! Please notice that I'm pretty new with all this, and as it's my first time running VPS, I do have a bit hard time understanding how everything works, at the moment... 43 comments 2 stephen640219 September 20, 2015 We have about 20 accounts on DigitalOcean and over the past two months ALL OF THEM have been experiencing this issue, even on droplets with 4GB RAM. We're migrating all of our sites elsewhere... 0 danny429396 October 1, 2015 I have the same problem as well. I often restart the server but each time I restart, same thing happen the next day and this is happening 50% of my websites on DigitalOcean. I do have website hosting elsewhere and they works perfectly fine with lower monthly cost. I'm moving all my websites elsewhere as well. It's just ridiculous. 0 nathanjameshill October 1, 2015 I have also experiences this issue over the last week. Does anyone have any idea what might cause this? Anyone got some alternative places to host? 0 romand October 1, 2015 Same issue for me! Glad I am no the only one.. i tried swap files and editing wp-config, but no help 0 accounting5f608 October 3, 2015 Same issue here. While the DigitalOcean team has been very helpful, I just can't get this site to function properly. I am going to have to migrate as we