Home arrow Archives arrow Software Tutorials arrow First Steps after installing WampServer - setting up MySQL and PHPMyAdmin

First Steps after installing WampServer - setting up MySQL and PHPMyAdmin

PDF  | Print |  E-mail
(0 votes)
Written by ultrabeast   
Friday, 04 July 2008
Basic Steps for setting up PHP, Joomla, Wordpress... on your own local PC
 
This article is written to remind me about the first steps to do after installing WampServer, but if it helps anyone who's looking to enhance their web life by getting a hand into the thick of things, that would be even better.

To make it easier for readers who are not so familiar with these stuff, I just typed out a brief introduction here.
 
First of all: You'll need to get this piece of software called WAMPServer.
Where? Do a google search for it and download it, you can get it from download.com too.
What does it basically mean - Windows Apache MySQL PHP.
So what do they do?

Read More...
 
Windows means your own PC's OS, as opposed to Linux. In which case that would be LAMP instead.
 
Apache is the http server, to enable your own PC to serve http pages - the standard pages that you open in your browser.. such as this one. The other option is to use Microsoft IIS, but that one is really a pain to set up (I've done that a number of times, but just once is really enough.)
 
MySQL is a free database system, where your entries, users, everything, is going to be stored. Having written software that links to MS Access before, for our usage I would say that MySQL is totally superior, easy enough to use, and free.
 
PHP enables you to use server-side scripting - that is, enable you to write some scripts which will be executed by the host (in this case, your own PC) to do neat stuff, such as dynamically populating webpages with content pulled out from a database like MySQL. It's a staple of the web scene nowadays; can't live without it.
 
Apart from that, PHP already has many useful built-in functions to process, filter and display text, as opposed to some other programming languages where you have to write everything yourself. And being web-oriented as it is, it gives you the potential for wide distribution of whatever software you write... as opposed to the loneliness of writing standalone programs - which I've been doing during an earlier period of my life...
 
(BTW just slot in a note here - Anyone with experience with PEAR? Gimme a buzz here...)

 
Installation of WAMPServer
This should be pretty straightforward, just follow all the instructions. Gimme a buzz if in doubt.
At this point, for new users, you should make a note of where you installed your Wamp, most likely in C:\wamp.
 
After installation and starting WAMP, you can go to your browser and type in localhost in the address bar and go there. A default status page will show up.
From there, you can view your MySQL database by clicking on the PHPMyAdmin (PMA) link.
 
The first time you use PMA, you will enter the database as the super administrator, without being prompted to enter a username and password.
Obviously this is not secure especially when you want to set up a live site, so this is what we want to change.
 
Bring up the "MySQL Console" by left-clicking on the Wamp system tray icon (the 'speedometer'-looking thing), looking for that item somewhere there, and then follow the steps below.
After bringing up that screen, follow the instructions below:
 
Setting the MySQL Root Password
You need to change the default root password on your MySQL Windows install. Write your password down somewhere so you don't forget it.

At the MySQL prompt:

TYPE THIS AT THE PROMPT.
  1. mysql -u root
  2. SET PASSWORD FOR 'root'@'localhost' = PASSWORD('yourpasswordhere');
  3. DELETE FROM mysql.user WHERE Host='localhost' AND User='""';
  4. FLUSH PRIVILEGES;

These commands change your root password and remove another out-of-the-box root user to improve your security.
 
 
What you're actually doing is:
1. MySQL already has a default user (not sure what the user name is, probably 'root', probably 'empty string'?) with a blank password.
2. Anyhow you want to create a super-user, with a username (most usually 'root') and password of your choice.
3. So you do the above.
 
And so you successfully done that. So now you try to go log in to the PMA page again, but guess what?
 
mySQL: ERROR 1045: Access denied for user: 'root@localhost' (Using password: NO)
 
You are rudely confronted by this error message from PMA.
 
However, no need to panic, it just means that you need to tell PMA that it needs to expect the user to enter a username and password.

Go to your wamp installation folder, and search for the file config.inc.php, usually it's in the phpmyadmin folder but the folder name might be different for different installation packages of WampServer. Anyway find that file, and open it in a text editor.
 
Look for these lines:
 
$cfg['Servers'][$i]['auth_type'] = '';
$cfg['blowfish_secret'] = '';
 
Change these to
 
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['blowfish_secret'] = 'yoursecretwordhere';
 
If you like, you can look for these lines
$cfg['Servers'][$i]['user'] = '';
$cfg['Servers'][$i]['password'] = '';
 
and change the values to '' (blank) as shown above. I don't remember if these two also need to be changed for stuff to work, but I think you can just leave it as it is.
 
Original full article from http://www.aota.net/PHP_and_MySQL/phpmyadmin.php4 but the gist of it, in plain English, is right here. So, read on...
 
Now what actually happens by choosing 'cookie' means that you will be prompted for a username and password when you next try to open PMA, In fact, do that now and log in, using the username and pwd that you just created for yourself. You can try going to Database>mysql(17)>user>Browse.. and see if you ('root') are the only user there. Optional step, but the paranoid obsessive-compulsive me always does that.
 
With that setting set to 'cookie', you can log in and log out of PMA just as in those web-based mail services. That's just all it means.
 
Now blowfish_secret, which apart from being a really cute name, simply means a text string that is used to somehow encrypt your password. Just write something here within the limit specified there in config.inc.php, and forget about it.


...To be continued in the next post: MySQL database character set, and 'collation'




 

Reference for above section:
 
$cfg['Servers'][$i]['user'] = ''; -- MySQL username if you are using config method - otherwise leave blank

$cfg['Servers'][$i]['password'] = ''; -- MySQL password only if you are using config method - otherwise leave blank

$cfg['blowfish_secret'] = ''; -- used with the cookie method only. If you specified cookie in the auth_type above, type in a random passphrase for this setting. The passphrase is just used internally to encrypt the password - you will not be prompted for it later.
$cfg['Servers'][$i]['auth_type'] = ''; -- dictates the authentication method used when connecting to your phpMyAdmin installation.
The three options for authentication are:

  • config (the default method)
  • http
  • cookie (recommended method)
Comments
Add New Search RSS
Divine Fang     |2008-07-05 00:22:53
avatar I didn't finish reading this article because I am using something wiki call "lazy man's WAMP/LAMP installation" i.e XAMPP

X (meaning cross-platform)
Apache
MySQL
PHP
Perl
ultrabeast  - XAMPP vs. WAMP   |2008-07-05 07:23:05
avatar Thanks for sharing this info abt XAMPP!

Hmmm... I've never tried it yet, but objectively, XAMPP does sound superior on two counts -

X - Cross platform
P - Perl capability included

As implied in this article, WAMP has the shortcoming that by default it creates a superadmin MySQL user with blank password, and by default does not require login to enter PMA. This is what is addressed in the article above because 100% of people would want to change from these default settings, and it does involve some steps.

I am not sure if XAMPP would ask you to create a MySQL superuser name and password during its installation process itself, and then set up PMA accordingly. If so, it'll be better.

My work laptop which I installed WAMP on is getting reformatted, so I have an excuse to try XAMPP out ~!
Divine Fang  - re: XAMPP vs. WAMP   |2008-07-05 13:10:58
avatar
ultrabeast wrote:

I am not sure if XAMPP would ask you to create a MySQL superuser name and password during its installation process itself, and then set up PMA accordingly. If so, it'll be better.

It has been a while since I last installed XAMPP and if I'm not wrong, it will create the superuser and pwd Then you'll have access to PMA straightaway after installation.

ultrabeast wrote:
My work laptop which I installed WAMP on is getting reformatted, so I have an excuse to try XAMPP out ~!

Wah, 'work laptop' getting a reformat wor... must be headache leh... My laptop got many problems+virus I oso dun format... will waste at least 2 days.
Write comment
Name:
Email:
 
Website:
Title:
UBBCode:
[b] [i] [u] [url] [quote] [code] [img] 
 
 
:angry::0:confused::cheer:B):evil::silly::dry::lol::kiss::D:pinch:
:(:shock::X:side::):P:unsure::woohoo::huh::whistle:;):s
:!::?::idea::arrow:
 
Please input the anti-spam code that you can read in the image.

3.22 Copyright (C) 2007 Alain Georgette / Copyright (C) 2006 Frantisek Hliva. All rights reserved."


Tags:  tutorial, PHP, Joomla, WAMP, MySQL, PHPMyAdmin
 
< Prev   Next >
Advertisement

Random Item

Latest Comments!

RSS Syndication


Save to FireFox Live Bookmarks:
feed-icon-12x12-orange.gif
View Feed XML

Search I, UltraBeast!

ShoutMix CB


Say No to Internet Explorer!

- This site will give an "Operation Aborted" error with IE whenever there are photo galleries on the page.

- MOZILLA FIREFOX is the recommended browser.

- Let me know if there are problems with Opera, Safari, etc.
Thanks ~

Problems Registering?

If you have problems getting your activation email, fret not:
  • Simply log in below using your Username and Password to get that mail sent again to you.
  • Check your bulk/junk/trash mail.
  • Rinse and repeat as many times as necessary.
Should all else fail - I can be contacted at
Email webmaster

Login





Live Traffic Feed

Who's Online

No Users Online
© 2008 Interview With The UltraBeast
Joomla! is Free Software released under the GNU/GPL License.