List:General Discussion« Previous MessageNext Message »
From:Peter Normann Date:June 9 2005 4:15am
Subject:RE: WebHosting with MySQL.......
View as plain text  
Ashok Kumar wrote:
> Hi Peter,
>  If i give the localhost/IP addr, How can i set the
> security previleges in my server/system( i have
> installed apache server to run the scripts). as i told
> earlier i'm using win2000 os, its expecting lot of
> securitie prevleges. i can't find those settings. if u
> know abt apache server means pls tell something abt
> that.

It is not the apache server that accesses the mysql server, but the
scripting engine of your choice.

>  I tried to access my system's mysql db and as well as
> the scripts in the apache server from other system,
> it's asking for the username and password. I didn't
> give any username and pwd to my system(i disabled sys
> pwd) and also to db. Why it's asking for the username
> and pwd. i tried all the username and pwd
> combinations. but no result.
>  If u have any idea pls share with me.

When connecting to the mysql server in your script, you must use three
parameters:

1. Host name / ip address
2. Username 
3. Password

I am not familiar with the scripting engine of your choice, but the command
to set up a connection to a mysql server would be something like: 

 // Establish connection
 myConnection = mysql_connect (myHostName, myUserName, myPassword);

 // Select database on server using connection
 myDatabase = mysql_select_db( myDatabaseName, myConnection);


Check the documentation for the scripting engine for the right syntax and
commands.

The username is the name of a mysql user etc.


Now, consider you have created a database called 'myDatabaseName' you have
to set up the user (myUserName) to allow access to this database:

1. Enter the mysql command line client

   mysql> GRANT ALL PRIVILEGES ON myDatabaseName.* TO
'myUserName'@'HostNameOrIPAddressOfApacheServer' IDENTIFIED BY 'myPassword';

2. Flush the mysql server user privilege cache

   mysql> FLUSH PRIVILEGES;

Now go read the manual.


Peter Normann


Thread
WebHosting with MySQL.......Ashok Kumar8 Jun
  • RE: WebHosting with MySQL.......Peter Normann8 Jun
RE: WebHosting with MySQL.......Peter Normann8 Jun
RE: WebHosting with MySQL.......Peter Normann9 Jun