Board index   FAQ   Search  
Register  Login
Board index php forum :: Database mySQL & php coding

Remote SQL?

Codes here !

Moderators: macek, egami, gesf

Remote SQL?

Postby eddy05 » Fri Jun 06, 2003 4:38 am

I have a question.

I'm able to connect and access to by database if I used mysql_connect("localhost") but I cannot access my database if I put mysql_connect("203.125.125.203") instead. (Assuming that was my IP.

The error i got was:

Access denied for user: '@203.125.125.203' to database 'db1'

I wanna know how I can configure my MySQL settings so that I can (1)define a username and password - I'm new to MySQL.
(2) Restrict/Allow access to MySQL server by IP. The user and password thing is more important. Please help. Thanks.
User avatar
eddy05
New php-forum User
New php-forum User
 
Posts: 10
Joined: Tue Mar 04, 2003 6:46 pm
Location: Singapore

Postby liquedus » Fri Jun 06, 2003 4:48 am

to create a user and grant rights:

GRANT ALL ON databasename.* TO username IDENTIFIED BY 'password'

you can change ALL to other things such as SELECT which would allow the user to only run SELECT statements on the tables.

you can also specify a table name instead of * after the . By doing so the user will only be able to access that table in that database.

question 2

GRANT ALL ON databasename.* TO username@localhost

GRANT ALL ON databasename.* TO username@someurl.com

GRANT ALL ON databasename.* TO 'username'@'64.230.%'

hope that helps
liquedus
php-forum Active User
php-forum Active User
 
Posts: 266
Joined: Tue Apr 08, 2003 5:18 am
Location: Ottawa, Canada

Re: Remote SQL?

Postby WiZARD » Fri Jun 06, 2003 7:12 am

or you seat before router where MySQL port closed....
User avatar
WiZARD
Moderator
Moderator
 
Posts: 1257
Joined: Thu Jun 20, 2002 10:14 pm
Location: Ukraine, Crimea, Simferopol


Return to mySQL & php coding

Who is online

Users browsing this forum: Bing [Bot] and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron