Share on Google+Share on Google+

MySql Alter User

Advertisement
This example illustrates how to alter user table.

MySql Alter User

This example illustrates how to alter user table.

In this example we alter user table in which add a column by query "ALTER TABLE user ADD COLUMN userid INT". In the first table we can see there is only three column but after the alteration in the next table we can see there is four column.

Query

CREATE USER 'user'@'localhost' IDENTIFIED BY '1234556978';
Query
GRANT SELECT,INSERT,UPDATE,DELETE ON *.* TO 'user'@'localhost';
Query
show grants for user@localhost;

Output

+---------------------------------------------------------------------------------------------------------------------
-----------------+
| Grants for user@localhost
                 |
+---------------------------------------------------------------------------------------------------------------------
-----------------+
| GRANT SELECT, INSERT, UPDATE, DELETE ON *.* TO 'user'@'localhost' IDENTIFIED BY PASSWORD '*C59B95112565D0CB68F9AAB8E
48ABA4790367F48' |
+---------------------------------------------------------------------------------------------------------------------
-----------------+

Advertisements

Advertisement

Posted on: December 9, 2010 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.