Crear Usuario Mysql con créate user
Enter
password: ***
Welcome to
the MySQL monitor. Commands end with ;
or \g.
Your MySQL
connection id is 1
Server
version: 6.0.4-alpha-community-log MySQL Community Server (GPL) Type 'help;' or
'\h' for help. Type '\c' to clear the buffer.
mysql> #
mysql -u root -p
mysql>
create user foo identified by 'miguel';
Query OK, 0
rows affected (4.13 sec)
mysql>
select password('miguel');
+-------------------------------------------+
|
password('miguel ')
|
+-------------------------------------------+
| *A350D0P364256874H1F091FF3ED45F42KLME63DFH
|
+-------------------------------------------+
1 row in
set (0.22 sec)
mysql>
drop user foo;
Query OK, 0
rows affected (0.22 sec)
mysql>
grant all privileges on *.* to 'maria'@'localhost'
-> identified by 'miguel'with grant
option;
Query OK, 0
rows affected (0.03 sec)
mysql>
grant usage on *.* to 'maria'@'localhost' with max_queries_per_hour 90;
Query OK, 0
rows affected (0.03 sec)
mysql>
show grants for 'esther'@'localhost';
+---------------------------------------------------------------------------------------------------------------------------------------------------------------
---+
| Grants
for maria@localhost
|
+---------------------------------------------------------------------------------------------------------------------------------------------------------------
---+
| GRANT ALL
PRIVILEGES ON *.* TO 'maria'@'localhost' IDENTIFIED BY PASSWORD '*A350D0P364256874H1F091FF3ED45F42KLME63DFH
' WITH GRANT OPTION MAX_QUERIES_PER_HOUR
90 |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------
---+
1 row in
set (0.03 sec)
mysql> revoke
insert on *.* from 'maria'@'localhost';
Query OK, 0
rows affected (0.00 sec)
mysql> revoke
select on *.* from 'maria'@'localhost';
Query OK, 0
rows affected (0.00 sec)
mysql>
show grants for 'maria'@'localhost';
+---------------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------+
| Grants
for maria@localhost
|
+---------------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------+
| GRANT
UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES,
INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EX
ECUTE,
REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE,
ALTER ROUTINE, CREATE USER, EVENT, TRIGGER ON *.* TO 'mariar'@'localhost'
IDENTIFIED
BY PASSWORD '*A350D0P364256874H1F091FF3ED45F42KLME63DFH ' WITH GRANT OPTION
MAX_QUERIES_PER_HOUR 90 |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------+
1 row in
set (0.00 sec)
mysql>
flush privileges;
Query OK, 0
rows affected (0.32 sec)
No hay comentarios.:
Publicar un comentario