Mittwoch, 9. Juni 2010

external mysql access

This has nothing to do with debian lenny

To grant an user the right to access to the mysql database from any other places than local you have add an entry to your user table:


INSERT INTO `mysql`.`user` (
`Host` ,
`User` ,
`Password` ,
`Select_priv` ,
`Insert_priv` ,
`Update_priv` ,
`Delete_priv` ,
`Create_priv` ,
`Drop_priv` ,
`Reload_priv` ,
`Shutdown_priv` ,
`Process_priv` ,
`File_priv` ,
`Grant_priv` ,
`References_priv` ,
`Index_priv` ,
`Alter_priv` ,
`Show_db_priv` ,
`Super_priv` ,
`Create_tmp_table_priv` ,
`Lock_tables_priv` ,
`Execute_priv` ,
`Repl_slave_priv` ,
`Repl_client_priv` ,
`Create_view_priv` ,
`Show_view_priv` ,
`Create_routine_priv` ,
`Alter_routine_priv` ,
`Create_user_priv` ,
`Event_priv` ,
`Trigger_priv` ,
`ssl_type` ,
`max_questions` ,
`max_updates` ,
`max_connections` ,
`max_user_connections`
)
VALUES (
'%', 'dbuser', 'md5pwhash', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', '', '0', '0', '0', '0'
);


INSERT INTO `mysql`.`db` (
`Host` ,
`Db` ,
`User` ,
`Select_priv` ,
`Insert_priv` ,
`Update_priv` ,
`Delete_priv` ,
`Create_priv` ,
`Drop_priv` ,
`Grant_priv` ,
`References_priv` ,
`Index_priv` ,
`Alter_priv` ,
`Create_tmp_table_priv` ,
`Lock_tables_priv` ,
`Create_view_priv` ,
`Show_view_priv` ,
`Create_routine_priv` ,
`Alter_routine_priv` ,
`Execute_priv` ,
`Event_priv` ,
`Trigger_priv`
)
VALUES (
'%', 'database', 'dbuser', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'N', 'Y', 'Y', 'Y', 'N', 'N', 'N', 'N', 'N', 'N', 'N'
);


flush privileges;

0 Kommentare:

Kommentar veröffentlichen