• PeterJones47

    (@peterjones47)


    My hosting company allows me to do Addon Domains, so I added mydomain.wordpress.com
    I then downloaded WordPress and used an ftp program to copy the files into a site folder called wordpress.
    I then edited the wp-config-sample.php and saved it as wp-config.php
    The only 3 changes I made were to: The name of the database for WordPress, MySQL database username, and MySQL database password.
    I put mydomain.wordpress.com for the DB_NAME. and I used my Dashboard to confirm my username and password.
    I then attempt to visit my instal.php file but get an error message:
    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.
    Has anyone got any ides please?
    The hosting company is knethosting.co.uk and I still have the MySQL hostname set to localhost, could that be the problem? or is it because I have used an addon domain?
    All help appreciated
    David

Viewing 13 replies - 1 through 13 (of 13 total)
  • Hi, an addon domain is a completely different domain. For example, if the primary domain on the account is domain.com the addon would be something different like newdomain.com. You’ll have to register each additional one and pay yearly fees.

    If you have just one domain you can install WordPress on a subdomain (subdomain.domain.com), subdirectory (domain.com/directory) or in the root folder (domain.com).

    Let me know if that clears things up. From what you described I think that’s what the problem is.

    peter achutha

    (@peter-achutha)

    Hi PeterJones47,

    You said “I put mydomain.wordpress.com for the DB_NAME. and I used my Dashboard to confirm my username and password.”

    When you installed WP it would have created a new db and empty one. So you db name will not be mydomain.wordpress.com which is your domain name. Check with your host tech support what db was created or check with phpmydmin. Your host tech support will be able to tell you what your password is. Some host default it to a WP username and WP password.

    @peter achutha. Unless he used a one-click installer WordPress does not automatically make a database. If he did use a one-click installer it would have automatically put that info into the wp-config.php file. However, he stated he copied the WP files via ftp so this is all not the case.

    @peterjones47 What’s the url of this site? It’s impossible that you have added an addon domain “mydomain.wordpress.com.” You can only get a domain with the “.wordpress.com” part through a WP hosted blog at https://www.wordpress.com.

    peter achutha

    (@peter-achutha)

    @patrick Nommensen. Thanks for the info. I was suspecting @peterjone47 over wrote his original data in the config file.

    Thread Starter PeterJones47

    (@peterjones47)

    Thanks everyone but I am confused. I do not have WordPress installed (or I don’t think I have), I created my website/blog online. I thought that by running the instal.php page was how I saw supposed to install it?
    My website is dorsetgables.wordpress.com and the only place I can see what I think is the wp-config.php information is by entering the dashboard, then clicking on Users – Personal Settings. The username and password are at the bottom of the page.
    I have never had an original config file to overwrite.
    Anyway, I have now removed the addon from my host server and I have tried a subdomain but I still have the same problem.
    Thanks

    peter achutha

    (@peter-achutha)

    1. It just hit me that yours was not a self hosted site. You are hosting at wordpress.com. I have never used them as host.

    OR

    your have a self hosted site but got your domain name wrong. My guess is that when you added domain name as a sub-domain or an addon domain it would be

    wordpress.mydomain.com … where wordpress is a subdirectory under mydomain directory.

    and not https://mydomain.wordpress.com

    If yours is a self hosted site, meaning your are not using WordPress to host your site:-

    2. When you install WordPress, especially the one click installations, you will need to specify the database name. Give it name. Many host will use your hosting account username as your database username and your hosting account password as you database password. If you installation procedure asks you for them you can use your account username and password or give a different password.

    3. When you said “I then downloaded WordPress and used an ftp program to copy the files into a site folder called wordpress.”. This may give you additional problems.

    Go through the full fresh installation, don’t copy any files. I believe you have database somewhere else, right? It looks like you are either moving site or moving to a sub-domain, right? Are you moving your wordpress site to another domain? or are you creating a new wordpress site? If you are creating a new wordpress site you should be ready to go. It should work like a new installation – empty, blank, fresh and don’t modify your config files.

    Be very careful here
    please see https://codex.www.ads-software.com/Moving_WordPress for correct procedure.

    Options are:-

    if you are moving to a subdomain Backup your original database, export using phpmyadmin.

    a. Then use phpmyadmin to import the data into your new database or upload the .sql file that was generated by the export and ask your tech support to import it into your new database. There may be a few mods to the tables in the database – I’m not sure.

    OR

    b. Modify your config.php file to set database name to the old database. This can work if your websites are on the same host account but you may have to edit the database.

    please see https://codex.www.ads-software.com/Moving_WordPress for correct procedure.

    if it works ok reinstall your plugins and your themes.

    I hope this helps and I do hope you can get it running.

    Moderator cubecolour

    (@numeeja)

    For WordPress.com support go to https://en.forums.wordpress.com

    Thread Starter PeterJones47

    (@peterjones47)

    I do not have a wordpress database yet, which is why I thought DB_NAME was dorsetgables.wordpress.com which is the only name I have.
    My next move will be to contact Support who are closed till tomorrow morning. I expect that they can tell me my database name, username and password.
    Many thanks everyone.

    @peterjones47. I’m still very confused what’s going on here. In your original post you said:

    I then downloaded WordPress and used an ftp program to copy the files into a site folder called wordpress.I then edited the wp-config-sample.php and saved it as wp-config.php. The only 3 changes I made were to: The name of the database for WordPress, MySQL database username, and MySQL database password.

    Why do you need the name, username and password of the database? You don’t host the website. Are you trying to transfer the site to you’re own hosting account?

    Thread Starter PeterJones47

    (@peterjones47)

    Well I thought that I needed those details to correctly edit the wp-config.php page.
    When wp-config is correct can I not then go on and instal WordPress? Is that not what it is all about?

    I’m not sure what the problem is. Your website is at https://dorsetgables.wordpress.com/ . The website is running and it’s run through the free services provided at https://www.wordpress.com. You don’t need to do any changes in the wp-config.php file unless you have your own domain such as https://www.dorsetgables.com.

    fonglh

    (@fonglh)

    WordPress.COM and www.ads-software.com are not the same.

    This page explains the differences.
    https://en.support.wordpress.com/com-vs-org/

    Thread Starter PeterJones47

    (@peterjones47)

    Thanks everyone, I am obviously not understanding what this is all about.
    Thought that it was necessary to install WordPress to proceed further, before I could start using some of the program plugins and extras that I have read about… obviously not.
    Sorry to have troubled everyone.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘wp-config.php problem’ is closed to new replies.