Setting up Wordpress with Xampp on Mac - php

I am trying to get Wordpress working locally on my Mac. I've downloaded and installed Xampp and also the Wordpress module. But I'm not sure where to go from here, to actually get Wordpress working.
When I try to reach 127.0.0.1/wordpress/ and localhost/wordpress/ I only get the message "Error establishing a database connection".
I can reach PhpMyAdmin, enclosing a screenshot.
Screenshot from phpMyAdmin
I have no clue where to go from here. Do I need to make changes in some conf-files or something? This is the first time I'm doing this so sorry for noob questions, I'm not really a programmer, just want to be able to build my Wordpress sites locally... :)

You need to create a database within PHPMyAdmin, and then configure wp-config.php with the database information. By default, you may only have a file called wp-config-sample.php. Rename the file, and remove -sample from the file name.
The host name will be "localhost", since the database is locally hosted.
The username will be the username to phpmyadmin, and the password will be the password for that account.
The database name will be the database name that you chose.
The prefix can be left alone, as the default is just fine. :)

Related

Can't Select Database WordPress localhost setup

I have no very little experience with coding in general and no relevant experience with WordPress. This is my first attempt to set up a WordPress site. I am using Wamp server on Windows 10 and I followed a beginner tutorial on how to set up a local WordPress site.
I have set up a Wamp server and have WordPress setup running on my localhost. I get the error Can't select database when attempting to set up. The name of my database in MySQL has no spaces in it and it SEEMS that the database has privileges set for the default user of root, it says "ALL PRIVILEGES" I did some research and I think it is setting a config file to "localhost:3308" instead of "localhost" the posting describes users changing various elements of PHP files. to edit the database connection details "wp-admin_setup-config.php_step=1", another user changed the database host setting on the setup page, which I assume has something to do with Wamp Server.
WordPress Forum
Can't select database error.
I looked in the WordPress directories for several of the PHP setting files that they recommended in various forums and stack overflow discussions, And I don't know where to add this.
Thanks

WordPress Installation Using Mamp: Error establishing a database connection

I am a beginner in WordPress. I have been doing an Udemy course, entitled "WordPress Theme Development Using Bootstrap" by Brad Hussey.
I have installed MAMP. Then I followed all the instructions of the tutorial to create a new database and a new user account via PHPMyAdmin. Then I edit the wp-config-sample.php file appropriately using the correct credentials. I copied all the codes from https://api.wordpress.org/secret-key/1.1/salt/ and paste them in the right place. Then I renamed the file to wp-config.php. Now, when I go to http://localhost/wp-admin/ in my browser, the following error appears:
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 localhost. 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.
I have typed the correct username and password in the wp-config.php file. I had typed the hostname as "localhost". And MySQL server is running on MAMP. So, I have done everything correctly. But can't get rid of this frustrating issue. Please, help me. I cannot proceed further to this course without solving it.
I have already seen some of the YouTube videos explaining the same solution that I tried to follow. It worked for them, but not for me.

WordPress site isn't working after I migrated site - changed site address (URL)

I migrated from my local computer to my live server using Duplicator. When I switched over, my Wordpress Address (URL) was http://107.343.442.344 - my IP address - and the Site Address (URL) was http://nameofwebsite.com. Everything appears to be working just fine.
However, when I add an item to my cart and try to delete it, it doesn't remove the item. I check the console and there's a failed AJAX request. It's requesting information from http://107.343.442.344. So, I change the Site URL to http://107.343.442.344 and then the everything works just fine. However, now I can't go to my front page.
I tried making these changes to the database (WP-Options), but nothing works.
Does anyone know what I can do to correct the problem. I've contacted WooCommerce, but they're taking forever.
My site is not currently up, so you can't go to it.
Easiest way how to properly migrate your site from localhost to server:
Copy all your local site files to web server
Install and activate "WP Migrate DB" plugin to your local site, it's free and got all functionality you will need.
After "WP Migrate DB" activation you will find it under "Tools" > "Migrate DB". Open "Migrate DB", there will be empty "Replace" block with two fields which you need to fill (look at the picture below).
These two fields are only one you need to fill, after that click on "Export" button and plugin will download mysql database.
Login into your hosting cPanel (or any other webhosting management app if your hosting doesn't provide cPanel, for example, ISPconfig etc.) and create new database or replace old one with that which you just created with "WP Migrate DB" plugin.
Open and edit wp-config.php file on your public_html folder on webserver, replacing database name and other authentification credentials (change database name, database user and password which you created in cPanel) and save this file.
Done, enjoy. :)
i think you database is not migrate properly please try again with wp migrate db plugin or search replace file , if problem still appear then check the serve file and folder permissions
So I found out what the problem was. I was using VHS Host to redirect the IP address to my new server. Once I changed the nameservers to point towards my new server, it worked.
Thanks to everyone who posted a response. I really do appreciate it.

Error on Wordpress Admin URL after moving from localhost to remote

I have created a WordPress project in my localhost, this is working.
I sent my project to git repository for hosting this in my VPS, I cloned the project in my VPS and imported my local database to remote database.
My Wordpress is hosting in remote, but why when I try access admin area with url hwsystem.com.br/wp-admin, this redirecting me to http://localhost/wp-login.php?redirect_to=http%3A%2F%2Fhwsystem.com.br%2Fwp-admin%2F&reauth=1 ?
How can I fix this problem?
I found where the problem is!
This problem is because I import database of my local database, where options_value of options_name in wp_options table is http://localhost, I just change it to my remote domain and is working.
When You move your files please login to your database and update the wp_options table site url and home url fields to your actual location.
Then login to the back end and update all permalinks
All done!
In your wp_options table in the MySQL DB, change the site url value to the remote site's domain name (i.e., hwsystem.com.br). It's most likely currently set to localhost You can also make this change within the admin interface, but seeing as you cannot access it, you'll need to change this value directly within the database.
Depending on your comfortability with MySQL, you can easily update this value with a SQL command, or use a GUI application such as HeidiSQL.
Moving a Wordpress website from localhost to online is not that simple, some times there are a lot of urls you have to change instead of only dealing with wp_options for example images path usually include the full localhost address.
The best and simplest way to make this right is by using this plugin: Duplicator
It will make any needed change it needs to happen, check it out.
You can also try to search and remove/replace localhost strings or anything else with this tool also https://github.com/interconnectit/Search-Replace-DB this works too.

Images not being found moodle

I am doing some moodle development and have pulled down an existing moodle and set it up on my local machine.
The site runs fine apart from no images display
I am running the site locally as moodle-hy:8080.
The images that are being fetched however are looking at
GET http://localhost:8888/pluginfile.php/107/mod_label/intro/elearning.jpg 404 (Not Found)
Moodle stores all the images in the database and I know there is a missing link in the chain I just cant figure out where it is.
I think it's worth pointing out you may need to run the database search and replace script, at:
http://my-public-ip/moodle/admin/tool/replace/index.php
as referenced in Method 2 here.
This is required if you change the name of the site once you have installed it. If you were already using Moodle under "localhost", then there will be a number of references to the old localhost address stored in the database that need to be updated to the new moodle-hy address.

Categories