![]() – DB_PASSWORD : the password that I use to log into PhPMyAdmin. – DB_USER : the username I use to log into the local PhpMyAdmin (it’s “root”). ![]() – DB_NAME : the name of the database which I imported in PhpMyAdmin These are the changes I made to wp-config.php: In fact, even when prompting mysql -u root -p, and then prompt USE db_name, everything works well. I replaced the Username Password and db_name with the ones that I use in PhpMyAdmin. Now, I have to edit the wp-config.php in MAMP/htdocs/my_website_name in order to tell the local website to use the right database. – Import the database in “local” PhpMyAdmin of MAMP – Download my website’s database using mysqldump in terminal – Download WP files of my website with filezilla If you find anything of the following procedure to be wrong, don’t hesitate to point it out. But everything is way more complicated than I expected. Check your Web Host (MySQL Server)Ĭreate a new file called testconnection.I’m trying to use my WordPress website locally (to test changes before making them to the live website). ![]() If everything in this file is correct (make sure you check for typos), then it is fair to say that there is something wrong on the server end. IP’s will vary for online web hosting services. For example on MAMP, the DB_Host value when changed to the IP may seem to work. It is common to see this sort of issue when running WordPress on a local server environment. Some folks suggested that they fixed their problem by replacing localhost with the IP. For popular hosts like HostGator, BlueHost, SiteGround, it is localhost. Depending on the host, it will be different. Remember your DB_Host value might not always be localhost. Make screenshot of website with device frame in Chrome First thing you should always check is if everything in your wp-config.php file is the same.ĭefine('DB_PASSWORD', 'database-password') If you changed your root password, or the database user password, then you will need to change this file as well. This is where you specify the details for WordPress to connect your database. WP-Config.php is probably the single most important file in your entire WordPress installation. Once you have done that, you can see the settings by visiting this page: Checking the WP-Config file You can do this by adding the following line in your wp-config.php file “One or more database tables are unavailable. If you are getting a different error on the wp-admin for instance something like:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |