$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>multisite - Error establishing a database connection after moving local wordpressmultisite from one directory to another|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

multisite - Error establishing a database connection after moving local wordpressmultisite from one directory to another

matteradmin11PV0评论

Good day together, as the title mentions, i want to clone a local wordpressmultisite(i use xampp) to another directory. the first existing mutlisite runs under xampp on http://localhost/Wordpress. the second blog of this wpms can be reached under http://localhost/Wordpress/buddha. this multisite is working fine.

Now i want to run a copy of this multisite installation under http://localhost/wp-buddha. So i copied all files and directories from the htdocs/Wordpress directory of xampp and paste it in a directory named wp-buddha ind the htdocs of the xampp directory.

In the next step i created a new databse named buddha by using myphpadmin on localhost. i created also a user for this database named buddha with the passswort buddha.

then i exported all tables from the first multisitedatabes to a sql file and imported the sql file in the nwe buddha databse.

I changed in the new multisite the databse informations such as databasename passwort and databaseuser to the new one.

Now, i my understanding, wordpress should be able to connect to the new databsse called buddha, even if the paths of the subdirectories are not actual.

But when accessing the site over http://localhost/wp-buddha there appears: Error establishing a databse connection.

I tested the databse informations with a php-script: they arte correct. Can anybody give me a clue why tha database connection isn´t working properly? thanks for any help.

Good day together, as the title mentions, i want to clone a local wordpressmultisite(i use xampp) to another directory. the first existing mutlisite runs under xampp on http://localhost/Wordpress. the second blog of this wpms can be reached under http://localhost/Wordpress/buddha. this multisite is working fine.

Now i want to run a copy of this multisite installation under http://localhost/wp-buddha. So i copied all files and directories from the htdocs/Wordpress directory of xampp and paste it in a directory named wp-buddha ind the htdocs of the xampp directory.

In the next step i created a new databse named buddha by using myphpadmin on localhost. i created also a user for this database named buddha with the passswort buddha.

then i exported all tables from the first multisitedatabes to a sql file and imported the sql file in the nwe buddha databse.

I changed in the new multisite the databse informations such as databasename passwort and databaseuser to the new one.

Now, i my understanding, wordpress should be able to connect to the new databsse called buddha, even if the paths of the subdirectories are not actual.

But when accessing the site over http://localhost/wp-buddha there appears: Error establishing a databse connection.

I tested the databse informations with a php-script: they arte correct. Can anybody give me a clue why tha database connection isn´t working properly? thanks for any help.

Share Improve this question asked Mar 9, 2019 at 16:58 user162820user162820 1
Add a comment  | 

1 Answer 1

Reset to default 0

Thanks for sharing the issues. I will share you how can you move the wp website another folder. Please follow my instruction step by step.

Step 1: Copy the all source code this folder location "http://localhost/Wordpress/buddha" file. Step 2: When you copy all file then Pleas paste the all source file this folder location "http://localhost/wp-buddha". Step 3: Create a new database from "http://localhost/phpmyadmin". Then import the database. Step 4: Open the config.php file and change the only database name.

define('DB_NAME', 'write_db_name_here');

/** MySQL database username */ define('DB_USER', 'root');

/** MySQL database password */ define('DB_PASSWORD', '');

Step 5: Please go to the database table "wp_options" change the URL link.

Please follow the screenshot instructions. Hopefully, it will be working fine.

https://drive.google/drive/folders/1RXW633LYUWuPdSBfj-UNKqCA_kzV--8N?usp=sharing

Post a comment

comment list (0)

  1. No comments so far