WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Uploading off of localhost (16 posts)

  1. larana84
    Member
    Posted 4 years ago #

    I have a Mac, so I set up a localhost with MAMP and WordPress. I don't know if I'm missing something, but I can't figure out how to upload my files so that the changes I make on localhost show up online. I used Fetch to copy over the files in MAMP>htdocs>wordpress to ftp, but I get a "Error establishing a database connection" message when I go to my site. (I'm not sure I have all the terms right -- I'm new to this).

  2. Those are two different issues: None of your content is going to show up online unless you export your localhost database and import it to your hosted WP install, and then change URL and other options with phpmyadmin. If you are getting a database connection error at your web host, that means you don't have a database set up, or you have the wrong info in wp-config.php.

  3. larana84
    Member
    Posted 4 years ago #

    Thanks for your speedy reply, songdogtech. For the second issue, I have a database set up on MAMP, and it matches the info I put into wp-config. I've been looking around where people have been trying different designations to MySQL hostname (like IP address) and I've tried them all with no success. Could be because of my first issue. To export localhost database, I downloaded Fetch, connected to http://ftp.website.com, deleted what was in there already, then dragged over everything in MAMP>htdocs>wordpress to the ftp. Was that right? I've been scouring the internet for info on how to do this export, but I find very little, and nothing for Macs. It makes me wonder if this is just common knowledge that passed me by?

  4. larana84
    Member
    Posted 4 years ago #

    Please help. I've been scouring the internet with no results, and I'm after days of this I'm ready to throw in the towel. Were the files in the htdocs folder the right files to drag over? I've also tried to export from phpMyAdmin in MAMP and manually change all the localhost:8888/database designations to mywebsite.com, but then where do I upload it?

  5. cubecolour
    ɹoʇɐɹǝpoɯ
    Posted 4 years ago #

    You can replace the local address with the live-site address where in the database export file if you are not comfortable with running SQL queries, however I think it would be easier to use the search & replace function in your text editor for this. Textwrangler has a good search & replace.

    You haven't mentioned that you have set up a database on your hosting. Reading between the lines I think that may be the problem. Once that is setup you need to import the edited backup file into it and edit the wp-config on your 'live' to connect to that database.

  6. larana84
    Member
    Posted 4 years ago #

    Thanks for your reply, numeeja. I'm afraid I'm trying to learn this solo, and have no experience with this. I'm not sure of everything you're referring to in your explanation. I have a database set up for WordPress at http://localhost:8888/MAMP/ and created a new user with username, password, and host (localhost). I put this information into wp-config in the htdocs folder on my computer. For the search and replace, do you mean export something from phpMyAdmin and change localhost to my website address? And then what? I can't find explicit instructions on the web.

    Thanks!

  7. cubecolour
    ɹoʇɐɹǝpoɯ
    Posted 4 years ago #

    Each installation of WordPress needs a database, so to make a clone of your local site online on your hosting account you need to not only ftp the WordPress files, but also create a database within your hosting account. You cannot use your local database.

    You can do a database backup from within WordPress using a backup plugin such as WP-DBManager or by exporting a SQL file from within phpMyAdmin.

    Then you can do the search & replace on that file to change every instance of your localhost URL to your online domain.

    Then zip the file and inport it into the database on your webhost.

    Ensure the wp-config on the webhost has the correct connection details for the online database.

  8. larana84
    Member
    Posted 4 years ago #

    Thanks for you continued help, numeeja. I've set up an online database on GoDaddy and have called it wordpressjessie. The offline database is called WordPress. When I export WordPress and try to import it to wordpressjessie, it gives me the following error message:

    SQL query:

    --
    -- Database: WordPress
    --
    CREATE DATABASE WordPress DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;

    MySQL said: Documentation
    #1044 - Access denied for user 'wordpressjessie'@'%' to database 'Wordpress'

    I changed all the instances of localhost to my domain before import. Do you know how to successfully import the database?

  9. YouTube- How to install a localhost on your Mac using MAMP and related videos.

    You use phpmyadmin on your webhost to import the database. You can also export WP content through Dashboard/Tools/Export and then Import on the webserver.

  10. Access denied for user 'wordpressjessie'@'%' to database 'Wordpress'

    Have you installed wordpress at GoDaddy? Or are you trying to import the database at GoDaddy with phpmyadmin before installing wordpress?

  11. larana84
    Member
    Posted 4 years ago #

    Thanks for your help again songdogtech. I looked at that video and a lot of other videos, but none of them gave any new info I didn't already know. I still get the error message in my previous post. There must be something really simple that I'm not getting. I export the database from WordPress (offline), change the instances of localhost to my domain, then tried to import to wordpressjessie (online). Is it some kind of user problem, where the user of wordpressjessie (me) is not set up to access WordPress? Do I need to have the same password for both databases?

  12. larana84
    Member
    Posted 4 years ago #

    Have you installed wordpress at GoDaddy? Or are you trying to import the database at GoDaddy with phpmyadmin before installing wordpress?

    I'm trying to import the database before installing wordpress. Should I install wordpress first?

  13. Why not export your localhost WP content in XML through Dashboard/Tools/Export and then Import into wordpress at GoDaddy? Then you don't have to use phpmyadmin.

  14. userword
    Member
    Posted 4 years ago #

    Hmm. Ive spent evening with exactly the same thing as you. Me using XAMPP on windows. After uploading it all and importing local database i could not connet.

    Answer

    User not created in the database.

    If you are using MAMP at some point you created a database for wordpress and user for it. That user is like login user and password that wordpress install is gonna use whenever it needs to connect to the database. The fun part is that specially in shared hosts they usually add a prefix to the user so if your user was

    hello

    and your domain is

    http://www.mydomain.com

    user is set as

    mydomain_hello

    go to wp-config and read which user and password is wrtitten there to connect to the database

    if you are using cpanel in your host go to MYSQL DATABASES forget about phpmyadmin if you compare phpmyadmin in your MAMP localhost installation with what you have in phpmyadmin in your host you will notice some tabs missing i dont know but suppose that they disable some functions like database deleting (all database not just tables) database creation, users creation and deletion, and some other things for security reasons.

    so in MYSQL DATABASES scroll down until you see some options for user creation. Try to make the same you have in your MAMP install and select privileges for it (i selected all but dont know if it is necessary codex is no very specific it says all you need to use and modify).

    if you notice some prefix is added and not optional just create it this way then go back to wp-config and change it user to the one you created.

  15. larana84
    Member
    Posted 4 years ago #

    Thanks for all your help, everyone! I created an online database, uploaded WordPress, fiddled with the settings, and finally got it to work! The final step was removing
    -- Database: WordPress
    --
    CREATE DATABASE WordPress DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
    USE WordPress;
    from wp-config. Not sure why, but it was giving me an error message.

    I appreciate the time you all took with a newbie. Thanks again!

  16. cubecolour
    ɹoʇɐɹǝpoɯ
    Posted 4 years ago #

    Great! Glad you got it working :o)

Topic Closed

This topic has been closed to new replies.

About this Topic