Showing posts with label website. Show all posts
Showing posts with label website. Show all posts

Wednesday, November 13, 2013

How to import DB Files from old XAMPP folder to new

I was updating my XAMPP htdocs folder on my 3rd computer at my office (I had to change because of defects and upgrades), when I realized that my old works was not in my current htdocs folder. I decided to copy the old files into my new folder and when I checked it on a browser I forgot that the DB files are not yet imported. I searched for automatic and manual methods, but then I found nothing(Or at least I thought, I usually eye the first 3-5 results on Google). And so, what I did was, I browsed every folder on XAMPP that would give me hints what to do.

Until I reached the 'mysql' (In terms of common sense you would go first with 'phpmyadmin' and 'mysql') then I found folders inside /xampp/mysql/data that are named as what my old DB's were.

I copied these specific folders pasted them into the same folder on the current xampp folder, then VoilĂ ! You can now check your phpMyAdmin and see your old DBs listed on the left sidebar.

Sunday, July 14, 2013

Wordpress: How to Manually Add Users in wp_user

What you need:
-phpMyAdmin access
-Wordpress Database Name
-Wordpress Database Username
-Wordpress Database Password

If you don't know your wordpress website's DB info, you can locate them in your wp-config.php file (located at the root folder). Although from what I experienced, I did not use the DB login details but still, if ever there will be cases you'll be needing it, it's safer you already know where to find them.

There are 2 tables to edit. First would be wp_users, we will ad a new user profile in this table. Then wp_usermeta, where we will put permissions and privileges.

Adding a user on wp_user:

Click on the wp_user table and then click Insert tab.
Table fields:
By default, this is incremental so leave this blank
This will be your username for Wordpress access
This will be your password for Wordpress access (note: use the functionMD5 - this will make your password encyrpted)
This will be you name displayed on front end pages. This is different with username
This is your own email address for reference and future password retrieval
This is your own URL. this is not required
Date when you registered
leave this blank
leave this set to 0 (zero)
Same as nicename

If you entered all the necessary details needed, click Go at the bottom of the page.
If there are no errors with the SQL commands then you can proceed to the wp_usermeta table.
(If there are errors, please repeat the insertion of details and double check every word)

Adding user permission on the wp_usermeta:

After adding a user on the wp_user table, we will set administrative permissions to that user by adding wp_capabiilties and wp_user_level on the wp_usermeta table. Before inserting any data here, you must first check and get the ID  that was auto-generated to the ID field from the wp_user table.
Click on the wp_usermeta table, click Insert tab.
Table fields:

Insert data for wp_capabilities


This is Incremental so leave this blank
Enter the User ID that was auto-generated a while ago from the recent wp_user addition
Enter here wp_capabilities
Enter here a:1:{s:13:"administrator";b:1;} 
Insert new data for wp_user_level



This is Incremental so leave this blank
Enter the User ID that was auto-generated a while ago from the recent wp_user addition
Enter here wp_user_level
Enter here 10
Double check everything and then click Go to insert the rows.

After you follow these steps you would now be able to login using your new user account details. You can update you profile information once you enter the admin page.