Wordpress Installation Database Error - Blog

WordPress Installation Database Error

By admin 0 Comment March 5, 2019

How to Install WordPress 4.7 Using Apache or Nginx on RHEL/CentOS and Fedora

by Ravi Saive | Published: May 17, 2016 | Last Updated: February 24, 2017

WordPress is an open source and free blogging application and a dynamic CMS (Content Management System) developed using MySQL and PHP. It has huge number of third party plugins and themes. WordPress currently one of the most popular blogging platform available on the internet and used by millions of people across the globe.

In this article, I will show you how to install WordPress using LAMP (Linux, Apache, MySQL/MariaDB, PHP) and LEMP (Linux, Nginx, MySQL/MariaDB, PHP) on RHEL/CentOS 7/6 and Fedora 25-20 and older Linux distributions.

So, please select your installation method based on your web server and distribution.

What Is LAMP and LEMP?

LAMP (Linux, Apache, MySQL, PHP) and LEMP (Linux, Nginx, MySQL, PHP) is an open source Web application platform that runs on Linux systems. Apache and Nginx both are Web servers, MySQL is RDMS (Relational Database Management System) and PHP is a server side scripting language.

As I said above, I will show WordPress installation on both Apache and Nginx Web server as follows:

Install WordPress On Apache Web Server

This installation guide shows you how to install latest WordPress using LAMP setup on RHEL 7/6, CentOS 7/6 and Fedora 25-20.

Step 1: Install LAMP Environment

In case, if you don’t have LAMP setup on your systems, please use the following instructions to install it.

After MySQL/MariaDB installed, run the following command and follow on screen wizard to secure your MySQL installation.

Step 2: Download WordPress

You must be root user to download the package.

Step 3: Extracting WordPress Files to Apache

Once the download finishes, run the following command to untar it.

Step 4: Creating MySQL Database WordPress

Connect to MySQL server and run the following commands to create database and grant privileges.

Please replace text a shown in Red color with your appropriate Database Name, User and Password. These settings we will required later.

Step 4: Creating Apache VirtualHost for WordPress

Open the file /etc/httpd/conf/httpd.conf with VI editor.

Add the following lines of code at the bottom of the file. Replace the text shown in Red color with your required settings.

Next, restart the Apache service to reflect changes.

Add the following line to /etc/hosts file.

Step 5: Configuring WordPress Installation

Copy default wp-config-sample.php to wp-config.php to configure WordPress installation.

Open wp-config.php file.

Modify the following database settings as we created in the Step #3 above.

Step 6: Finishing WordPress Installation

Open your browser and type any of the following address.

Give your Site Title, Create Admin User, Create Admin Password, Enter Your E-Mail and then click on Install button.

WordPress Site Settings

Login into your WordPress Dashboard.

View your New WordPress blog.

WordPress Site View

Install WordPress On Nginx Web Server

Step 1: Creating WordPress Directories for Nginx

Step 2: Downloading and Extracting WordPress

Step 3: Creating MySQL Database WordPress

Connect to MySQL server and run the following commands to create database and grant privileges.

Please replace text a shown in Red color with your appropriate Database Name, User and Password. These settings we will required later.

Step 4: Creating Nginx VirtualHost For WordPress

If you’ve followed our LEMP guide these directories are already created. In case, if not then please create it by running these commands.

Add the following line of code to /etc/nginx/nginx.conf file, After the line that says “include /etc/nginx/conf.d/*.conf.

Next create Nginx virtualhost file for WordPress.

Add the following content to /etc/nginx/sites-available/wordpress.conf file.

Create symlink for sites enabled directory.

Disable Selinux by issuing the below command:

Restart the Nginx server to reflect changes.

Add the following line to /etc/hosts file.

Step 5: Configuring WordPress Installation

Copy default wp-config-sample.php to wp-config.php to configure WordPress installation.

Modify the following database settings as we created in the Step #3 above.

Now follow STEP 6 above for the WordPress installation.

Finally, just make sure you enable the services system-wide by issuing the following commands with root privileges:

On RHEL/CentOS 7 and Fedora 22-25

On RHEL/CentOS 6 and Fedora 15-21

In case, if you are having any trouble while installing please do let me know via comments and don’t forget to share this article with your friends.

How to Uninstall and Reinstall WordPress

Last updated: November 14, 2016

In this post I have explained how you can uninstall and reinstall WordPress. You will rarely think about uninstalling/reinstalling WordPress on your site unless you start having ‘Apache security mod rewrite and htaccess’ issue like myself. I decided to Reinstall WordPress on one of my sites after trying numerous fixes to solve the issue and getting no result. Some people uninstall/reinstall WordPress to start over from scratch. Anyway, whatever the reason is, you can uninstall and reinstall WordPress using one of the following methods:

Approach 1 (Full Clean Uninstall)

  1. Delete all your WordPress files and folders from the site (usually from your ‘public_html’ directory).
  2. Delete the WordPress database user and table (usually through ‘cPanel’ control panel if your site has ‘cPanel’). Go to the MySQL database section and you can remove the database and DB users from that interface.
  3. Now Install WordPress from the beginning like you did the first time and you are done (How to install WordPress).

Approach 2 (Quick Fix Uninstall)

  1. Delete the WordPress database user and table.
  2. Create new database user and table and update the ‘wp-config.php’ file with the new information (alternatively you can reuse the same user name and table name from previous and you won’t have to update the ‘wp-config.php’ file)
  3. Run the installer (install.php) by visiting your site.

How to Delete the WordPress Files and Folders

You can delete all of your WordPress files using one of the following methods:

Option 1: Log into your site’s cPanel/Control panel and go to the file browser. Find the folder where all the WordPress files are and remove those files.

Option 2: Log into your site using a FTP software (example, FileZiall). Go to the folder where WordPress is installed. Select all the files and folder then hit the delete button then confirm the deletion.

Option 3: If you have shell access to your server then you can log into your server using a SSH client then browse to the folder where WordPress is installed. Now issue the “rm” UNIX command to remove files and folders. This option should only be exercised by advanced users who are familiar with the UNIX system.

If you want to do a full WordPress blog deletion then check our how to delete a wordpress blog tutorial.

Video Tutorial

Additional Tips

#1) The tutorial on exporting and importing database tables should be helpful for the above operation.

#2) It is always a good idea to use the ‘robots.txt’ on your site to control the access of the web robots such as Google bot from coming and indexing your site when you are doing extended maintenance. You don’t want the bot to crawl and index your site when you just deleted the entire content of your site! Read the How to control access of the web crawlers or web robots to your site article to learn more.

#3) Get a cheap and reliable hosting for your WordPress site. The support team of a good webhost will help you if you have messed up the WordPress install.

Related Posts

Web Development, WordPress Database, Database Recovery, uninstall, Web Development, WordPress, WordPress install

Reader Interactions

Comments (39 responses)

Thanks saved my site from a real mess. w3 total cache was messing it up with that plugin gone all screwy thanks.
Then had issue logging into WordPress between you guys and this site here we got it all sorted. Yay

How to Install WordPress 4.7 Using Apache or Nginx on RHEL/CentOS and Fedora

by Ravi Saive | Published: May 17, 2016 | Last Updated: February 24, 2017

WordPress is an open source and free blogging application and a dynamic CMS (Content Management System) developed using MySQL and PHP. It has huge number of third party plugins and themes. WordPress currently one of the most popular blogging platform available on the internet and used by millions of people across the globe.

In this article, I will show you how to install WordPress using LAMP (Linux, Apache, MySQL/MariaDB, PHP) and LEMP (Linux, Nginx, MySQL/MariaDB, PHP) on RHEL/CentOS 7/6 and Fedora 25-20 and older Linux distributions.

So, please select your installation method based on your web server and distribution.

What Is LAMP and LEMP?

LAMP (Linux, Apache, MySQL, PHP) and LEMP (Linux, Nginx, MySQL, PHP) is an open source Web application platform that runs on Linux systems. Apache and Nginx both are Web servers, MySQL is RDMS (Relational Database Management System) and PHP is a server side scripting language.

As I said above, I will show WordPress installation on both Apache and Nginx Web server as follows:

Install WordPress On Apache Web Server

This installation guide shows you how to install latest WordPress using LAMP setup on RHEL 7/6, CentOS 7/6 and Fedora 25-20.

Step 1: Install LAMP Environment

In case, if you don’t have LAMP setup on your systems, please use the following instructions to install it.

After MySQL/MariaDB installed, run the following command and follow on screen wizard to secure your MySQL installation.

Step 2: Download WordPress

You must be root user to download the package.

Step 3: Extracting WordPress Files to Apache

Once the download finishes, run the following command to untar it.

Step 4: Creating MySQL Database WordPress

Connect to MySQL server and run the following commands to create database and grant privileges.

Please replace text a shown in Red color with your appropriate Database Name, User and Password. These settings we will required later.

Step 4: Creating Apache VirtualHost for WordPress

Open the file /etc/httpd/conf/httpd.conf with VI editor.

Add the following lines of code at the bottom of the file. Replace the text shown in Red color with your required settings.

Next, restart the Apache service to reflect changes.

Add the following line to /etc/hosts file.

Step 5: Configuring WordPress Installation

Copy default wp-config-sample.php to wp-config.php to configure WordPress installation.

Open wp-config.php file.

Modify the following database settings as we created in the Step #3 above.

Step 6: Finishing WordPress Installation

Open your browser and type any of the following address.

Give your Site Title, Create Admin User, Create Admin Password, Enter Your E-Mail and then click on Install button.

WordPress Site Settings

Login into your WordPress Dashboard.

View your New WordPress blog.

WordPress Site View

Install WordPress On Nginx Web Server

Step 1: Creating WordPress Directories for Nginx

Step 2: Downloading and Extracting WordPress

Step 3: Creating MySQL Database WordPress

Connect to MySQL server and run the following commands to create database and grant privileges.

Please replace text a shown in Red color with your appropriate Database Name, User and Password. These settings we will required later.

Step 4: Creating Nginx VirtualHost For WordPress

If you’ve followed our LEMP guide these directories are already created. In case, if not then please create it by running these commands.

Add the following line of code to /etc/nginx/nginx.conf file, After the line that says “include /etc/nginx/conf.d/*.conf.

Next create Nginx virtualhost file for WordPress.

Add the following content to /etc/nginx/sites-available/wordpress.conf file.

Create symlink for sites enabled directory.

Disable Selinux by issuing the below command:

Restart the Nginx server to reflect changes.

Add the following line to /etc/hosts file.

Step 5: Configuring WordPress Installation

Copy default wp-config-sample.php to wp-config.php to configure WordPress installation.

Modify the following database settings as we created in the Step #3 above.

Now follow STEP 6 above for the WordPress installation.

Finally, just make sure you enable the services system-wide by issuing the following commands with root privileges:

On RHEL/CentOS 7 and Fedora 22-25

On RHEL/CentOS 6 and Fedora 15-21

In case, if you are having any trouble while installing please do let me know via comments and don’t forget to share this article with your friends.

How to Uninstall and Reinstall WordPress

Last updated: November 14, 2016

In this post I have explained how you can uninstall and reinstall WordPress. You will rarely think about uninstalling/reinstalling WordPress on your site unless you start having ‘Apache security mod rewrite and htaccess’ issue like myself. I decided to Reinstall WordPress on one of my sites after trying numerous fixes to solve the issue and getting no result. Some people uninstall/reinstall WordPress to start over from scratch. Anyway, whatever the reason is, you can uninstall and reinstall WordPress using one of the following methods:

Approach 1 (Full Clean Uninstall)

  1. Delete all your WordPress files and folders from the site (usually from your ‘public_html’ directory).
  2. Delete the WordPress database user and table (usually through ‘cPanel’ control panel if your site has ‘cPanel’). Go to the MySQL database section and you can remove the database and DB users from that interface.
  3. Now Install WordPress from the beginning like you did the first time and you are done (How to install WordPress).

Approach 2 (Quick Fix Uninstall)

  1. Delete the WordPress database user and table.
  2. Create new database user and table and update the ‘wp-config.php’ file with the new information (alternatively you can reuse the same user name and table name from previous and you won’t have to update the ‘wp-config.php’ file)
  3. Run the installer (install.php) by visiting your site.

How to Delete the WordPress Files and Folders

You can delete all of your WordPress files using one of the following methods:

Option 1: Log into your site’s cPanel/Control panel and go to the file browser. Find the folder where all the WordPress files are and remove those files.

Option 2: Log into your site using a FTP software (example, FileZiall). Go to the folder where WordPress is installed. Select all the files and folder then hit the delete button then confirm the deletion.

Option 3: If you have shell access to your server then you can log into your server using a SSH client then browse to the folder where WordPress is installed. Now issue the “rm” UNIX command to remove files and folders. This option should only be exercised by advanced users who are familiar with the UNIX system.

If you want to do a full WordPress blog deletion then check our how to delete a wordpress blog tutorial.

Video Tutorial

Additional Tips

#1) The tutorial on exporting and importing database tables should be helpful for the above operation.

#2) It is always a good idea to use the ‘robots.txt’ on your site to control the access of the web robots such as Google bot from coming and indexing your site when you are doing extended maintenance. You don’t want the bot to crawl and index your site when you just deleted the entire content of your site! Read the How to control access of the web crawlers or web robots to your site article to learn more.

#3) Get a cheap and reliable hosting for your WordPress site. The support team of a good webhost will help you if you have messed up the WordPress install.

Related Posts

Web Development, WordPress Database, Database Recovery, uninstall, Web Development, WordPress, WordPress install

Reader Interactions

Comments (39 responses)

Thanks saved my site from a real mess. w3 total cache was messing it up with that plugin gone all screwy thanks.
Then had issue logging into WordPress between you guys and this site here we got it all sorted. Yay

Add Comment

Your email address will not be published. Required fields are marked *