[Solved 2021] “Table Prefix” must not be empty - WordPress Error | The Tech Trackers

[Solved 2021] “Table Prefix” must not be empty - WordPress Error

By
Advertisement
Table Prefix” must not be empty

Hello Guys, you are here because you were installing WordPress via clean install method and on the 2nd step of the installation, you found an error that “Table Prefix” must not be empty”.

This is Rahul from The Tech Trackers and I encountered same error while installing WordPress for my client and I googled so much but didn’t find any solution to above problem. So, I rolled up my sleeves and dive deep into it and now we got the solution to the above error. I would like to share that solution with you guys.

So, read and follow below mentioned steps and if you have any questions and queries let me know in the comments section below.


You must have received above error while filling your database details.

Table Prefix” must not be empty.

In a normal case when you fill database details in the above form and hit submit then WordPress fill those details in wp-config.php file but, here we are getting an error so now we going to do this process manually. For that after getting “Table Prefix” must not be empty Error you have to open c-panel and locate wp-config-sample.php file. 

Open the sample file in an editor and edit database details (database name, username and password) manually and hit save.


Table Prefix” must not be empty
Then close sample file and rename it to wp-config.php

Once done with the rename process again go to the WordPress install screen.

Table Prefix” must not be empty

This time, once you select language, then WordPress will redirect you to welcome screen.


“Table Prefix” must not be empty - WordPress Error


Where you have to fill details like site title, username and password for WordPress etc. and hit install here after clicking on install button you will get below error “Please Provide valid username” and keep coming if you choose any username.

“Table Prefix” must not be empty - WordPress Error

Now, we have to skip this step as well to do that, again we have to go to C-panel and locate install.php file under wp-admin folder, Open install.php file and search for your error “Please provide a valid username” and then you will see sections like below image.

“Table Prefix” must not be empty - WordPress Error

Here we have to change $error = true; to $error = false; (This will disable validation for username field on above screen)

Now, again head toward welcome screen and hit install. This will install WordPress without any user it will look something like below image.

“Table Prefix” must not be empty - WordPress Error

As you can see WordPress installed on your domain, but you can’t login because there is no user created so now you have to create a user from PhpMyAdmin and assign him administrator rights.

To do that, you have to Access PhpMyAdmin from your cpanel. In PhpMyAdmin locate your database in my case, it’s “testblog2



“Table Prefix” must not be empty - WordPress Error

After choosing database, click on “wp_users” there you will see an empty table like below:
“Table Prefix” must not be empty - WordPress Error
Here you have to create a new user by clicking on the insert button on top ribbon as below:


“Table Prefix” must not be empty - WordPress Error

After clicking on insert button you will get below fields, where you have to fill details of users like username, password, email id etc. Leave id field blank because it will get generated automatically. And while entering a password change value of a function to MD5 .

Now you have created a user via PhpMyAdmin now you can login via above details but you can’t access the dashboard for that you have to assign administrator rights to created user. 

“Table Prefix” must not be empty - WordPress Error

To check your user rights head to the “wp-usermeta” table in your database. This is the table where all Meta information of user gets stored. We have to modify this table to give admin rights to created user.

To simplify this process I have created an SQL file which you have import in your database but before that you have delete above “wp-usermeta” table by going into operations section.


“Table Prefix” must not be empty - WordPress Error

Now you have to download this SQL from here and open in any editor and search for “database name” and change the database name to your database name in my case it’s “testblog2” and save it.


Next step is, go to your database in PhpMyAdmin and click on import, where you have to select a downloaded SQL file and hit go. It will automatically run queries and assign administrator rights to our user.


“Table Prefix” must not be empty - WordPress Error

Now try logging in, this time you will be successfully redirected to the WordPress dashboard.


“Table Prefix” must not be empty - WordPress Error

That’s it! You have successfully installed WordPress by skipping  “Table Prefix” must not be empty error.

[Update] After following all the above steps if you can't get logged in to your dashboard your login page keeps refreshing like below:

“Table Prefix” must not be empty wordpress login page refreshing

Then we have to reset our .htaccess file to do that first you have to locate your .htaccess file.
By default cpanel hide .htaccess file to unhide that you have click on setting button at the top right corner in file manager then click on "Show Hidden Files" and save.

Now, you can see .htaccess file take backup of it by downloading on you computer and then delete that file from your online directory.

Once deleted, head back to login page and try again to login with username and password this time you will get redirected to Wordpress Dashboard.

If you like this article then share your thoughts in the comment section. I would love to hear from you guys.

Thank You.

12 comments:

  1. Hello,

    Thank you for this document so explicit but my side it does not work;
    when I change the name of the file, I am told that I need the sample file to continue and when I keep the 2 types of files, I am told that the file Conf.php already exists and if I want to continue it will be necessary that I delete it otherwise I am offered access to the installation page, and when I click nothing comes, not even an error message

    I am lost, I do not know what to do

    thank you in advance for your help

    ReplyDelete
    Replies
    1. Hello There,

      As I mentioned in above article first you have to locate "wp-config-sample.php" file and add database details in that file manually. once done with editing file save and then rename file to "wp-config.php". Once you renamed the file again start the installation process by choosing language. if need more help contact me via contact form I will guide you.

      Thank You,

      Delete
  2. Thank you. It worked

    ReplyDelete
    Replies
    1. Thank for your valuable feedback. Feel free to Share and subscribe to our newsletter.

      Delete
  3. Thanks a lot.It really works. I have done my job.

    ReplyDelete
    Replies
    1. Thank for your valuable feedback. Feel free to Share and subscribe to our newsletter.

      Delete
  4. IT didn't work on my localhost. Please what should I do?

    ReplyDelete
  5. Please follow each step as mentioned above in proper sequence and it will work. If still not working feel free to reach us by filling the contact form.

    ReplyDelete
  6. Hero! Thanks for your support.

    ReplyDelete
  7. Wanted to drop a comment and say thanks! Was getting errors on a new wordpress install and this has fixed it! Thank you so much!!!

    ReplyDelete
  8. Thanks so much Sir, you are the best!

    ReplyDelete
  9. But do you know what is the cause of this issue maybe?

    ReplyDelete

© 2016 The Tech Tracker . Powered by Blogger.