phpmyadmin

Creating separate databases and logins phpmyadmin on WAMP server

Editing and hacking your website in the live environment can be risky – a useful approach is to install WAMP server locally on your laptop, load up you website software, then carry out your hacks in a safe environment. Now we have set up correctlyas shown in the last tutorial creating separate logins for each application is very straightforward. Let’s assume I am going to create a local WordPress  instance on my laptop.

The next steps creates the logins:

  • Login to phpmyadmin user the root user and password
  • From the home administration screen go to the tab ‘Privileges’:

  • Select ‘Add a new User’ about a quarter of the way down on the left.

add user phpMyAdmin

  • The rest of the Add User dialogue opens up as shown.
  • Enter wordpress for the user name
  • Select local from the host drop down and localhost will appear in the field to the right.
  • Enter wordpress for the password (repeat wordpress in the retype box)
  • Select  the checkbox ‘Create database with same name and grant all privileges’
  • Check All for global privileges if you wish

create a data base same name user

Scroll down to the bottom of the screen and hit GO as shown on the screen shot.

select go to create the datebase

That’s it

The direct execution panel for SQL will show the query being run and the creation of the new databases along with the credentials we entered above.

Log out of root and you will go back to the initial login screen. To check all is OK just re login with the username ‘wordpress’ and password ‘wordpress’ to check all is in order.

Next:

  • Download the latest distribution of WordPress from www.wordpress.org (currently 3.1)
  • Unzip the package and copy the wordpress folder to the httpdocs folder usually c:\wamp\www\httpdocs\
  • When you have loaded wordpress to the httpdocs directory on the laptop  open up localhost from the wampserver services tab navigate to the wordpress directory and the famous wordpress install routine will start up. Just fill in the db user and password as ‘wordpress’ and enter the default user details and the install completes in about two seconds.

When that is complete just create an alias to wordpress or bookmark the local site to complete the process.

Repeat the above for each local application you wish to install.

So give it a try

Royston

Creating a login screen in phpMyAdmin

When installing local applications on your laptop to run on WAMP server it is often useful to create separate databases and logins for the applications so you can keep things in order. There are several ways to do this but I thought I would set down a step by step process that dummies such as me could follow.

So if you wish to install WordPress, Mantis or Limesurvey as local applications this short tutorial shows you how to do it.

When WAMP server is first installed the root user is created with no password and as default no login intermediate screen is available.

The first task is to edit the phpMyAdmin config file to correct this:

  • Navigate to C:\wamp\apps\phpmyadmin3.3.9
  • And open config.inc.php in wordpad
  • Define two passwords yourpasswordA and yourpasswordB
  • Add the changes to your config .inc.php file  as shown in red below
  • Save the file and close WordPad

Config.inc.php changes:

$cfg[‘blowfish_secret’] = ‘yourpasswordA’;

/* Servers configuration */
$i = 0;

/* Server: localhost [1] */
$i++;
$cfg[‘Servers’][$i][‘verbose’] = ‘localhost’;
$cfg[‘Servers’][$i][‘host’] = ‘localhost’;
$cfg[‘Servers’][$i][‘port’] = ”;
$cfg[‘Servers’][$i][‘socket’] = ”;
$cfg[‘Servers’][$i][‘connect_type’] = ‘tcp’;
$cfg[‘Servers’][$i][‘extension’] = ‘mysqli’;
$cfg[‘Servers’][$i][‘auth_type’] = ‘cookie‘;
$cfg[‘Servers’][$i][‘user’] = ‘root’;
$cfg[‘Servers’][$i][‘password’] = yourpasswordB‘;
$cfg[‘Servers’][$i][‘AllowNoPassword’] = false;

/* End of servers configuration */

$cfg[‘DefaultLang’] = ‘en-utf-8’;
$cfg[‘ServerDefault’] = 1;
$cfg[‘UploadDir’] = ”;
$cfg[‘SaveDir’] = ”;

/* rajk – for blobstreaming */
$cfg[‘Servers’][$i][‘bs_garbage_threshold’] = 50;
$cfg[‘Servers’][$i][‘bs_repository_threshold’] = ’32M’;
$cfg[‘Servers’][$i][‘bs_temp_blob_timeout’] = 600;
$cfg[‘Servers’][$i][‘bs_temp_log_threshold’] = ’32M’;

Next go to the WAMP server services panel and select phpMyAdmin

A login screen will appear as shown below – enter your login details as:

Username :Root

Password: yourpasswordB

Login Screen for phpMyAdmin

You will then be taken to the phpMyAdmin administration screen where you see you have logged in a root@localhost if all has gone well – this is the screen you normally go to when no login routine is in place.

admin screen phpmyadmin

Next step creating logins