I have a hosted drupal website (in zipped folder). I wish to copy it on localhost using XAMPP.
I have extracted the website folder (which is "myFolderName") and copied it to C:/xampp/htdocs.
But when I type localhost/myFolderName, it gives
Site off-line
The site is currently not available due to technical problems. Please try again
later. Thank you for your understanding.....
The mysql error was: Access denied for user 'newdb'#'localhost' (using password: YES)"
To overcome this, I checked the settings.php file and it had $db_url = 'mysql://newdb:mypass#localhost/newdb;
So I tried to create a new user named newdb with password mypass on a newly created database newdb. But how can I import database and remove that error I listed above ?
I searched the myFolderName folder for .sql files, there are no such files to import in xampp.
I have mysql user and password both of the hosted website and when I remote login (using ssh on ubuntu), then I see a few databases and many tables but I am unable to locate these in myFolderName folder.
I just want to change a few images, add a few links and paragraphs and some php scripts to my website by first trying it on localhost before doing it directly on the hosted drupal website.
Moreover, the hosted drupal interface( at aws.amazon.com )does not allow to change certain portions of my website as the original hosted website was made using both hardcoded html and other scripts along to drupal editing.
Please help me as I am very new to drupal and want to change on my localhost (XAMPP) using html and php codes rather than drupal interfaces.
Finally, found it myself !
I used mysqldump -u newdb -p newdb > mydatabasefile.sql
where the first instance of "newdb" was my username and the second instance of "newdb" was my database name.
It prompted for a password which was "mypass" in my case.
Later, I imported this .sql file into my "newdb" database already created in xampp
Related
I had setup wordpress project in main url : www.example.com with help of cyber panel in aws-ec2 free hosting.
I had domain and setup wordpress via cyber panel.
Now, I want to setup small php project inside this like: www.example.com/mysmallproject
I had create folder : mysmallproject and add all files. its working well. I can access php file via browser.
ISSUE : I had created database via cyberpanel and assign domain.
It has username and password.
NOW, I need to access database. it requires username, password and database name and server name.
I have username, password, database name. But i dont know "SERVERNAME". I tried to get servername from my wordpress configuration file but its not working. Any suggestion will be appriciated. Thanks
The server name is your EC2 IP address or you can use "localhost".
I've spent a couple of days on this and it's probably an easy problem to fix, so I appreciate the help. I have MAMP installed and running locally with the document root path pointed to a folder named websites. In this folder I have 2 Wordpress websites, one that is working (website 1) and one that is not (website 2). I'd like help getting the Wordpress website that is not working (website 2) to work. The problem I'm trying to solve is to get a locally running version of a Wordpress site that was created using a one-click install feature from my hosting provider. This remote site has significant work that I'd like to replicate locally so I can improve it.
When I copy the remote Wordpress files, generated by my hosting provider, into my local websites folder, using FTP, Wordpress does not run at all, because it needs to connect to the database. I exported the data using phpMYAdmin from my remote site and imported it into my local phpMyAdmin and tried updating the wp-config.php file to reflect the local changes. However, the local site will not connect to the database, unless I completely reinstall Wordpress (losing all the changes to the site that I'm trying to download in the first place). The moral is I can't run the install process without losing my work.
The error that is displayed in the browser when I navigate to the second(not working) site, without running the install process, depends on what I have saved in the wp-config file:
Configuration #1: Inputs to incorrect working website 1 database - DB1
DB_Name = 'website_1_DB' //can't use this db
DB_User = 'local'
DB_Password = 'SHA1'
DB_Host = 'localhost'
localhost:8888/website1/ -> Output: Website 1 works fine
localhost:8888/website2/ -> Output: Error Establishing a Database Connection in Wordpress
Note: the above configuration was used in two different web-config.php files for both website1 and website 2.
Configuration #2: Correct DB2 and root user
For this configuration, I have confirmed in phpMyAdmin > DB2 > Privileges that root has 'All Privileges'
DB_Name = 'website_2_DB'
DB_User = 'root'
DB_Password = 'root'
DB_Host = 'localhost'
localhost:8888/website2/ -> Output: ERR_Connection_Refused
Configuration #3: Correct DB2 and added user from DB1
For this configuration, I've essentially used the user from Configuration #1 (working user) with DB2 (correct DB)
DB_Name = 'website_2_DB' //can't use this db
DB_User = 'local'
DB_Password = 'SHA1'
DB_Host = 'localhost'
localhost:8888/website2/ -> Output: It wants to run the Wordpress Install Process
Additional Information:
I have debugging turned on.
The table prefix seems to be accurate.
I've read these articles and posts.
How to Fix the Error Establishing a Database Connection in Wordpress
How to Edit wp-config.php File in Wordpress
Beginner's Guide to Wordpress Database Management with phpMyAdmin
How Wordpress Actually Works Behind the Scenes (Infographic)
Migrating a WordPress site to localhost
Connect Wordpress to the database
Wordpress: Workflows (2015)
I changed the web-config-sample.php to web-config.php essentially installing a new instance of Wordpress, which did connect to the correct DB1. However, what I'm trying to do is work on the Wordpress site that was created on the remote server. I'm trying to avoid having to reinstall the theme and update the configurations locally, but is this the only way? It seems like I should be able to move the whole installation back and forth between the server and localhost, with different configuration files, as different versions.
I think the problem is my method for migrating the website from the remote server where it was originally installed using my hosting service's 'one-click-install.' I just downloaded all the Wordpress files using FTP, then I then exported and imported the database using phpMyAdmin, updating the siteUrl to be as follows:
INSERT INTO `wp_options` (`option_id`, `option_name`, `option_value`, `autoload`) VALUES
(1, 'siteurl', 'http://localhost:8888/website2/', 'yes'),
(2, 'home', 'http://localhost:8888/website2/', 'yes'),
For website 1 (working locally), I followed a tutorial, but I can't remember which one. According to this infographic, there are a lot of places for me to look, does anyone have any clue where to start? Am I on the right path? It's obviously possible since I've done it before, but I've forgotten how I did it.
The bottom line is, how do I get a locally running copy of my remote Wordpress site?
Thank you for your help.
I don't recommend moving manually as it is quite a lot of work. You could use a WordPress Backup/Migration Tool to make this task easier. These plugins replace all the URLs automatically and you don't have to do anything.
Install a backup plugin on local WordPress site like Updraft or Duplicator.
Backup your website completely with the plugin.
Research and wisely choose the best web hosting provider for your WordPress site.
Get a domain name and setup the nameserver correctly to the web host (remote server).
Install the same backup plugin on your web host (remote server).
Upload the backup of your website via the backup plugin.
Done. Now your website will be live on your domain in your web host (remote server).
NOTE: If you are using some kind of page builder plugin on WordPress like Elementor, ensure to replace the existing URL (http://localhost/) with the new URL (https://example.com) using Elementor's Settings and Regenerate the CSS using Elementor's Settings.
You can find these settings on:
WP Admin > Elementor > Tools > Replace URL
WP Admin > Elementor > Tools > Regenerate CSS
I know the paint that you faced. I also run WordPress on my VPS. You might want to check updraft plugin to backup all your remote files and install them back to your local machine.
Or another thing is, I recommended that you use duplicator plugin. Good luck
i am very beginner in wordpress and want to learn it and the first step was fail :(
i tried to install it on localhost (xampp) and this error "Error establishing a database connection" kept shows
i did every step in this video https://www.youtube.com/watch?v=A3fXcvnzlkw
install xampp-osx-5.6.30.
turn on mysql database and apache server.
go to phpmyadmin and add new database name it "wp".
download wordpress 4.7.2
copy the wordpress folder to htdocs then rename it to wp.
go to wp-sample-config rename it to wp-config change the database name to wp, database username to root and database password empty ''.
in the browser localhost/wp/wp-admin/install.php
then the error shows
i tried to add new user in the phpmyadmin and change the wp-config
i tried to change the database host from localhost to 127.0.0.1 in wp-config
i tried to unistall xampp twice
i tried different program mamp
nothing helped
my os x version is os x yosemite 10.10.5
should i change any sittings in my computer?
is there any programs that i may install it causes the problem?
what can i do?
here some photo
wp-config /
Steps 6 and 7 aren't needed. WordPress creates the wp-config.php file when it discovers that there isn't one there. It prompts you for the database username, password, server (default localhost) and table prefix that you want.
Then it will ask you for some information about the site. Normally that's all you need to do, it will set up wordpress for you from this information. It might not like an empty password for the database user though. If you haven't changed the password you could try root as I think that is the default - root/root
You need to check first that xampp is working correctly though e.g. by outputting a simple html file.
I downloaded a WordPress website and copied it to a folder on localhost.
However the it's asking me for a database name which is WordPress as I created a database in phpmyadmin.
Then it asks for User Name : no matter what i type it does not accept it, the same goes for Password: and Database Host Name. I have no password on phpmyadmin i login as root and there is no password.
Can anyone help me with this please?
If you're really sure what your username and password are and still not working, you should download again wordpress... I've setup a few times Wordpress locally and I found it very simple. (Change directory name, different database name and so on).
I've just upload a WordPress project into a web server. Everything went fine with the exception of the User-Photo plugin. The problem I'm having is that its doesn't seems to find the basedir path. This is the error:
Upload error: Unable to place the user photo at: /var/www/clients/client2/web4/web/arsoblog/wp-content/uploads/userphoto/1.jpg
First of all, I don't know where this path is. Even on the local server, where the site is working good, is using the exact same path, which I can't find.
Maybe someone of you knows what could have changed from one server to the other. By the way, the blog is inside another site in the web server, which is developed using CakePHP.
EDIT --- I'm having the same problem with all the uploads!
The problem is in your upload directory. When we develop the WordPress site in localhost, the default upload directory will be point to your localhost only. When you move to online server, this directory path will not change.
To override this do the following steps:
Login to your cPanel/control Panel
Go to phpMyadmin
Select your database.
Go to wp_options table
On the second page (around 58th row) Edit 'upload_path'(For the first time this row may be blank).
Give your correct directory.Eg: /home/username/public_html/folder-name/wp-content/uploads
Change "username" and "folder-name". Username is usually the username you use to login to cPanel, or your domain’s control panel. Folder-name is used for the sites hosted in subfolders. If you hosted the site in root folder, remove it.
Here is a detailed tutorial How to move wordpress to a new server or host.
If you already used WordPress uploader in localhost, you need to do a search in wp_posts table and replace your localhost reference to your live site's reference. There are some plugin available to do these search and replace in database. Check this one
Hope this will solve your problem.
777 permissions are dangerous and not the correct fix for the issue. You will get hacked with 777 permissions. See Hardening WordPress « WordPress Codex
For solving this problem you have follow some step,
*Login to your cPanel/control Panel
*Go to phpMyadmin
*Select your database.
*Go to wp_options table
*On the second page (around 58th row) Edit 'upload_path'
*Give your correct directory.Eg: /home/username/public_html/folder-name/wp-content/uploads
then you shift your server See tutorial
for more
http://www.techyv.com/questions/error-when-running-wordpress-new-server