2005-02-15 22:36:46 +01:00
|
|
|
use mysql;
|
2015-08-11 18:45:38 +02:00
|
|
|
set sql_mode="";
|
2005-02-15 22:36:46 +01:00
|
|
|
create database MYSQLtest;
|
|
|
|
grant all on MySQLtest.* to mysqltest_1@localhost;
|
|
|
|
show grants for mysqltest_1@localhost;
|
|
|
|
Grants for mysqltest_1@localhost
|
2019-11-06 12:35:19 +01:00
|
|
|
GRANT USAGE ON *.* TO `mysqltest_1`@`localhost`
|
|
|
|
GRANT ALL PRIVILEGES ON `mysqltest`.* TO `mysqltest_1`@`localhost`
|
2005-02-15 22:36:46 +01:00
|
|
|
select * from db where user = 'mysqltest_1';
|
2018-02-12 16:26:11 +01:00
|
|
|
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 Delete_history_priv
|
2017-09-08 09:22:24 +02:00
|
|
|
localhost mysqltest mysqltest_1 Y Y Y Y Y Y N Y Y Y Y Y Y Y Y Y Y Y Y Y
|
2005-02-15 22:36:46 +01:00
|
|
|
update db set db = 'MYSQLtest' where db = 'mysqltest' and user = 'mysqltest_1' and host = 'localhost';
|
|
|
|
flush privileges;
|
|
|
|
show grants for mysqltest_1@localhost;
|
|
|
|
Grants for mysqltest_1@localhost
|
2019-11-06 12:35:19 +01:00
|
|
|
GRANT USAGE ON *.* TO `mysqltest_1`@`localhost`
|
|
|
|
GRANT ALL PRIVILEGES ON `mysqltest`.* TO `mysqltest_1`@`localhost`
|
2005-02-15 22:36:46 +01:00
|
|
|
select * from db where user = 'mysqltest_1';
|
2018-02-12 16:26:11 +01:00
|
|
|
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 Delete_history_priv
|
2017-09-08 09:22:24 +02:00
|
|
|
localhost MYSQLtest mysqltest_1 Y Y Y Y Y Y N Y Y Y Y Y Y Y Y Y Y Y Y Y
|
2005-02-15 22:36:46 +01:00
|
|
|
delete from db where db = 'MYSQLtest' and user = 'mysqltest_1' and host = 'localhost';
|
|
|
|
flush privileges;
|
|
|
|
drop user mysqltest_1@localhost;
|
|
|
|
drop database MYSQLtest;
|