Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress Local WordPress Development Local WordPress Development Installing WordPress Locally

Dale Shubrook
Dale Shubrook
237 Points

Can't create a user - advises no plugin installed?


Struggled for the last few days with this...so I've installed XAMPP fine, when I go to add a user to MySQL I get the following message:


SHOW PLUGINS SONAME LIKE '%_password_check%'

MySQL said:

1018 - can't read dir of 'C:\xampp\mysql\lib\plugin\'

(errno: 2 "No such file in directory")


Now I've checked and sure enough there is no directory under this folder/file name but the problem is I have no idea if I should have one or not, I've tried creating one and same issue.

I have XAMPP 5.6.30 installed on Win10... I've read online I can just manipulate the config file like other guides advise to do and manually editting it so the username is root and the database is set to the one I created, I then unzipped my Wordpress files into that and tried going to my localhost/localwp and I get the error "Error establishing database connection"... that's another problem in itself, and from what I read that links back to the credentials being incorrect.

I AM PULLING WHAT HAIR I HAVE LEFT OUT, any help is massively appreciated.

1 Answer

Hi Dale, Are you trying to create a user for your MySQL database, or are you trying to create a user for your WordPress website? The two are very different, so I just want to clarify. Normally when you install XAMPP, MySQL gets set up on your computer automatically, and it creates a default user for it, normally with the username root. I actually think that that root user doesn't even have a password, in other words the "correct" password is to keep the password blank. Further, you actually don't need to create a different user than root in order to use WordPress, or create a password-protected website, or anything; I actually think most people don't even bother creating a custom user for their local MySQL installations -- there really isn't much point. So you may be hassling with something that you don't even need to.

With that in mind, to set up your WordPress installation correctly on a local XAMPP server, you'd open up the wp-config-sample.php file that's in your WordPress file folder and use these settings where they're listed:

define('DB_USER', 'root');
define('DB_PASSWORD', '');
define('DB_HOST', 'localhost');

(You'll also need to add in whatever you actually named your database, where it says, "DB_NAME". I should say that clearly: you do need to create an empty database on your machine before you try to do the WordPress install in your browser using the steps in the next paragraph. You can name the database anything you like. If you don't know how to create a database, make sure XAMPP is running -- the icon will be green, not red or orange -- then try going to localhost/phpmyadmin in your internet browser. If you get to a real page, look for the Databases tab, click it, then type your database name in the text field where it says, "Create database" and click the Create button.)

Then change the name of that file to wp-config.php (remove the -sample), and try to visit your website's URL in your browser. You should be presented with the "set your language" prompt and then guided through the WordPress install.

On the other hand, if what you're really trying to do is create a new user on an existing WordPress website, just log in to your WordPress site at [your site's URL]/wp-login.php, click on Users in the left sidebar, then click Add New. It should be pretty straightforward.

Hope this helps you, and sorry this has been so much trouble so far! Do let me know if you get it working or have other questions.

Dale Shubrook
Dale Shubrook
237 Points

Eric, it's Valentines Day - and I love you. I was talking mySQL, I watched one of the tracks video and was being advised to create a user in my database that I created but was struggling with the above error... anyway I was sort of trying to do as you advised before and just edit the file myself and was changing the username to root but I wasn't clearing the password value but looking at your screenshot I see that you had so I gave it a shot...and what do'ya know! I can now continue, thanks for making it simple and going in depth so I can actually understand WHY I'm doing these steps etc.

Hahaha so happy to hear, Dale! We all hit these roadblocks no matter how experienced we are, and I definitely know the feeling of staring at the same code for hours not being able to see what's wrong. I'm glad I could help you figure this one out so you can keep going. Cheers!