Re: help!!!!!!!! MySQL, PHP, and Apache configuration.

From: Jeffrey Silverman (jeffrey_at_jhu.edu)
Date: 03/03/04


Date: Wed, 03 Mar 2004 17:41:20 -0500

On Wed, 03 Mar 2004 11:57:58 -0800, Josh wrote:

> Sorta... So do I put my IP in for the host or what? What do I put in
> for the host if I'm trying to run it as a test server? BTW if I dont
> include a password with my username and vise versa, it works no
> questions asked also if i dont put a pass or username it works...
> Thanx anyway.
> -Josh

The MySQL docs are confusing but thorough. Please read the section on
set-up and security very carefully.

It is *very* insecure to have a MySQL server running that allows access
without a password. This is what you described in the above paragraph.

Here are some things to consider:
1) Default MySQL instal has a "nousername"/"nopassword" user -- you can
log in with *no* username or password. This needs to be deleted from the
access tables immediatly.

2) Don't forget to FLUSH PRIVILEGES when you change passwords. Or restart
the server.

3) Dont forget a HOST associated with each username. The easiest way to
give a username access from any host is to use the '%' host (a wildcard
host).

example:

GRANT ALL PRIVILEGES on *.* TO '***'@'%' IDENTIFIED BY 'ocks';
FLUSH PRIVILEGES;

I'm pretty sure that will give access to username password ***/ocks from
any host, but I did that from memory and the syntax may be slightly off.
Please double-check with the MySQL Website.

4) You can, for testing purposes, give your machine ANY HOSTNAME YOU WANT!
All you have to do is stick some relevant entries in the /etc/hosts file
(Linux). I think it's %SYSTEM%\hosts on Windows.

example:

192.168.0.100 josh-is-cool.net

Of course, this will only work from the machine you are testing but it
will allow you to test things like NamedVirtualHostss in Apache without
actually buying a DNS name.

later...

-- 
    Jeffrey D. Silverman | jeffrey AT jhu DOT edu
                 Website | http://www.wse.jhu.edu/newtnotes/

Loading