|
|
To access the database from remote machine - Mysql
|
Views : 742
|
|
Tagged in : Mysql
|
|
|
Report This Scrap as Inappropriate We request you to choose the appropriate categroy and subcategory that suits your
objectionable concern about the scrap, So that our team can review and find out whether it violates our Guidelines or the
scrap is not suitable for all viewers.
|
To access database from remote machine by default is disabled.
Consider we use the mysql query tool from command prompt from a machine named ramya. When we try to connect to a mysql database running in machine name whocares from ramya, we will get
ERROR 1130 (00000): Host 'RAMYA' is not allowed to connect to this MySQL server
So we have to give permission in the mysql server running in whocares so that you can connect to this mysql server from ramya.
It can be done as follows
> open a command prompt in the machine whocares
> go to mysql bin folder [e.g C:\Program Files\MySQL\MySQL Server 5.0\bin
> go to mysql query tool by executing the file mysql [just type mysql and then press enter]
> execute the command "use mysql" - This will connect you to mysql database.
The database name mysql contain all the information on users, hosts and their privileges.
> Then you can use either GRANT query to add privileges or use insert query on host and user tables.
Using Grant
you can use "grant" option as,
grant all privileges on *.* to 'root'@'192.168.0.8' with grant option;
you can give either ip_address(192.168.0. or '%'.
if you give '%', it means that all machines which comes under the user 'root' can access the database.
using insert
Use grant will insert a rows in host and user table. So here we will do what GRANT will do. its boring now so i will add this section later.....
|
|
By - Ramya, On - 2008-03-12 |
|
|
|