Moving wordpress site from localhost to live server using GoDaddy cPanel - php

I'm using GoDaddy cPanel hosting to move my site from localhost. It's the first time I've done this and I've hit a dead end. I've followed the instructions from these instructions. I've used duplicator as a back-up whilst developing but I didn't use it for the FTP process.
I'm pretty sure there's a step in the process I'm missing but I can't spot it. I exported the database on localhost, created a new one in cPanel, imported across the localhost one. All the files are in the file manager portal but I'm not sure they're in the right place. The file trail is /home/cPanellogin/public_html/files - is this correct?
I've updated the wp-config file -
define('DB_NAME', 'new cPanel db name');
/** MySQL database username */
define('DB_USER', 'cPanel db user');
/** MySQL database password */
define('DB_PASSWORD', 'cPanel db password');
/** MySQL hostname */
define('DB_HOST', 'localhost');
The site link is here. I've never done this before so I'm pretty sure I'm missing some steps, any assistance would be really appreciated.

Move these ( home.html / layout styles.css / 404.shtml ) away in a folder for backup

Related

What we need to put in wp_config.php?

I tried uploading a wordpress site and I arrived to the step when I need to modify wp-config.php
Here's the code.
define('DB_NAME', 'replace_with_database_name_you_noted_down');
/** MySQL database username */
define('DB_USER', 'replace_with_new_host_mysql_user_name');
/** MySQL database password */
define('DB_PASSWORD', 'replace_with_new_host_mysql_password');
/** MySQL hostname */
define('DB_HOST', 'replace_with_new_mysql_host'
I don't understand what means "replace with new mysql host", because I have the files in wordpress directory and when I try to access the page, it returns "403 forbidden.The access for the server was
denied".
I mention that i tried that on a simple installation wordpress site, I cannot upload my site on cpanel, can you send me a tutorial and give me some suggestions please ?
In order to work wordpress need a sql database. You need to create one and a user with a password.
If you have cpanel you can install directly wordpress with one click with softaculous or other. This will create a database automaticaly and fill the wp-config for you.
If you install wordpress "manually", you have to fill the wp-config yourself. For MySQL hostname, you can try localhost (if the sql database and ftp hosting is at the same place)

Error establishing database connection in WordPress install

I am working with a managed server from 1&1 and I am trying to manually install WordPress with no luck. I went and downloaded the WP core files, uploaded them via FTP and then went into mySQL and created the database and username/password etc. and assigned the privileges. When I try to install wordpress via "www.example.com/wp-admin/install.php", I continuously receive the error:
Error establishing a database connection
I tried everything and triple checked my user,password, etc.
Here is my credentials (Password is hidden):
// ** MySQL settings ** //
/** The name of the database for WordPress */
define('DB_NAME', 'yourdb');
/** MySQL database username */
define('DB_USER', 'yourdb user');
/** MySQL database password */
define('DB_PASSWORD', 'yourpassword');
/** MySQL hostname */
define('DB_HOST', 'hostname');
Host name is always a localhost. for check your database credential is correct or not please feel a wrong value # let me know I am here
Try use 127.0.0.1 instead of localhost as the db host. Had the same issue and this fixed it for me.

Error establishing a database connection with WordPress and Azure

I have hosted a WordPress site, http://edufunweb.azurewebsites.net/, on Azure. It was working fine until I wanted to host another site. So I went to the edufun wp-config.php file in Microsoft Webmatrix and changed the line
$table_prefix = 'wp_';
to
$table_prefix = 'wp_2';
(or maybe it was the other way around) in order to have different tables in the database for each of the sites. Then I deleted the other site and now with whichever codes above I get a
Warning: mysql_connect(): Access denied for user 'abcd'#'xxx.yyy.zzz.xx' (using password: YES) in D:\home\site\wwwroot\wp-includes\wp-db.php on line 1461
Error establishing a database connection
This either means that the username and password information in your wp-config.php file is incorrect or we can't contact the database server at eu-cdbr-azure-north-c.cloudapp.net. This could mean your host's database server is down.
Are you sure you have the correct username and password?
Are you sure that you have typed the correct hostname?
Are you sure that the database server is running?
If you're unsure what these terms mean you should probably contact your host. If you still need help you can always visit the WordPress Support Forums.
Moreover, if I connect to http://edufunweb.azurewebsites.net/wp-admin/
I still get the same error.
Your help is highly appreciated as I need my website back on track!
I don't think this is a WP multi-site issue. This typically is caused when the connection string to the host mysql server is not correct.
Here's an easy way to test this.
Open wp-config.php and locate the following lines.
/** MySQL database username */
define('DB_USER', 'user_name');
/** MySQL database password */
define('DB_PASSWORD', 'user_password');
/** MySQL hostname */
define('DB_HOST', 'some_hostname');
Next, open your WP site in the Azure Management Portal. Go to the Configure tab and scroll down to Connection Strings. Click "Show Connection Strings". Copy it into a text editor and compare the values to what you see in wp-config.php. If those values are not the same then keep both copies and do the next step.
Next, open your local shell and open mysqladmin by typing in the following, replacing the values from above here below (without single quotes), note there is no space between the -p parameter and the password value itself.
mysqladmin -u user_name -puser_password -h some_hostname
One of those connection values should be correct and if so replace the one that is not correct with the one that is. If neither work, then go back to the Azure Management Portal to your site, click on Linked Resources, click the item that appears and you should be in the Clear DB management portal where you can get the correct connection information for your MySQL Database.
After you have sorted you can go configure your WP Multi-site. Here is an article on how to do that for Azure Web Apps, http://azure.microsoft.com/en-us/documentation/articles/web-sites-php-convert-wordpress-multisite/
hope that helps.
define( 'WP_ALLOW_MULTISITE', true );
define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', false);
define('DOMAIN_CURRENT_SITE', '');
define('PATH_CURRENT_SITE', '');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);
those lines add to config.php and check wp-admin, there is an option network admin. Go to the network admin and after that go to the settings and setup network from Network Setup option.
Go to the Site option and Add New Site.

EasyPHP - Taking WordPress live to localhost

I have been giving a task for a client to take their existing word press database and make changes to the client specifications. However I do not want to edit this database on their live website so I am trying to pull it from their server and work on it locally.
The problem I am having is that I managed to drag all the files successfully from their host and put them onto my localhost, however when I try to view it locally I get the error: "Error establishing a database connection"
As they can't give me their database to work locally on, I am in the position where I have their files locally on my machine but I am trying to access their live database.
So when I pulled the files down locally, I expected that my local machine will just connect to their live database automatically.
In the wp-config.php file I have the settings:
define('DB_NAME', '');
/** MySQL database username */
define('DB_USER', '');
/** MySQL database password */
define('DB_PASSWORD', '');
/** MySQL hostname */
define('DB_HOST', 'localhost');
Removed the db_name, username and password
The line I am looking at is 'localhost', would this need to be changed to their host? Because from what this says is that it will check the localhost on my local machine for the database which I do not have.
However on the server it would say check the localhost on the server which would be there?
So to sum this up, to get this working correctly, would I either need:
The database to export to my local machine
The IP / Hostname of where the database is stored?
Also is it possible to find out what this is without directly contacting the client as I doubt they will know this.
Cheers
I managed to get the IP they were using by pinging the live website through the command line.

Wordpress installation error: Error establishing a database conection

While trying install wordpress i recieve following error
I use wampserver i have changed wp-config.php file and now it looks like this:
define('DB_NAME', 'wordpress');
/** MySQL database username */
define('DB_USER', 'root');
/** MySQL database password */
define('DB_PASSWORD', 'root');
/** MySQL hostname */
define('DB_HOST', 'localhost');//i used 127.0.0.1 too but no matter
define('WP_DEBUG', true);
wp-db.php file:
1379 line:
mysqli_real_connect( $this->dbh, $host, $this->dbuser, $this->dbpassword, null, $port, $socket, $client_flags );
1409 line:
$this->dbh = mysqli_connect( $this->dbhost, $this->dbuser, $this->dbpassword, $new_link, $client_flags );
but still no result I do not know what to do can anyone help me?
You're trying to use wordpress locally i assume. 127.0.0.1. Then you must have a local database to store wordpress's data. something like WAMP on windows or LAMP on linux. If you already have one of these then you are probably getting an error because your database is not turned on. or you have not edited the wp-config file to include the database the username and password for the database you created. beyond that wordpress does the rest of the work.
You are not very clear of what system you are using, more info would be needed to diagnose your error completely.
so what OS?
what web server are you using? (apache WAMP or LAMP?)
is your database on?
have you edited the wp-config file to include your db info?
The error is pretty straightforward, but could come from a number of different sources.
What that error message means is that you have your setup file misconfigured. WordPress requires a SQL database it can create tables, read, write, and otherwise modify to make and store its content. The configuration you have set in your wp-config.php file is wrong.
Steps to Fix This
Make sure you have an SQL database
Make sure you have a user in your SQL server that can access that database fully and can log in from outside sources
Make sure you know the host, username (for the user previously mentioned), that user's password, and the database name
This is where you enter these into wp-config.php. By default, WordPress only comes with wp-config-example.php so you must set this information in that file, then rename it wp-config.php before navigating to your setup screen.
Also Note: It's possible WordPress cannot access your database because the user you are trying to log in with does not have outside access permissions. Might be worth checking. Also, the host is not always straightforward; if you use Dreamhost or Amazon Web Services, you cannot normally specify localhost as the location of your database server, unless you specifically set your machines to be that way.
WordPress can't...well... "establish a database connection", enable debugging in wp-config.php, this will show more information about the error, it could be a wrong password or server not responding...
Add this line anywhere in the file (like this ).
define('WP_DEBUG', true);
If the line is already there make sure it's true and not false.
answer is :
define('DB_PASSWORD', '');

Categories