Setting Up a MySQL User Account : Grant « User Permission « SQL / MySQL






Setting Up a MySQL User Account

       

% mysql -h localhost -p -u root
Enter password: ******
mysql> GRANT ALL ON cookbook.* TO 'cbuser'@'localhost' IDENTIFIED BY 'cbpass';
mysql> QUIT

   
    
    
    
    
    
    
  








Related examples in the same category

1.Verify the grant
2.Using the SHOW GRANTS Statement
3.Grant usage to a user
4.Connecting to the server as cbuser from a host named xyz.com, the GRANT statement should look like this
5.The following GRANT statement grants privileges to a user account named ethan.
6.The Grant Tables in the mysql database controls access to MySQL and the MySQL databases.
7.Reloads the grant table and returns version-related information
8.An example GRANT statement that assigns column-level privileges
9.GRANT statement specifies the MAX_QUERIES_PER_HOUR and MAX_UPDATES_PER_HOUR options, setting the value of each to 50
10.GRANT statement
11.SHOW GRANTS statement displays the user account information for user1@domain1.com
12.Using the FLUSH PRIVILEGES Statement to reload the grant tables into memory
13.Verify the grant.
14.Have the user joss grant the DELETE privilege to marti@localhost.
15.Grant the grant option
16.Check the grants
17.Grant select privilege to a user
18.Grant insert and update for user
19.Grant update for certain table
20.Grant select privilege for a database
21.Grant create, alter,drop and create view for a database
22.Grant select for information_schema for a user
23.Grant select and insert for all tables
24.Grant create, alter, drop privilege for all
25.Grant privilege for creating user
26.Grant all privileges
27.Grant references with grant option
28.Grant references
29.Grant insert privilege
30.Grant select on *.*
31.Grant select on * MAX_QUERIES_PER_HOUR 1
32.Revoke grant option
33.GRANT statement creates a user account and grants global-level privileges to that account
34.The GRANT statement grants SELECT and UPDATE privileges on all tables in the test database
35.To view how the user account is added to the grant tables
36.Now take a look at an example of a GRANT statement that uses a REQUIRE clause
37.GRANT ALL PRIVILEGES to a user from localhost
38.Flush the grant tables
39.Grant permission for event
40.Grant permission for a procedure
41.Give user permission for querying a view
42.Allow newUserName to sign in from any computer
43.Allow newUserName access to all databases
44.Give the SQL user BOOKSQL the privileges to create and manipulate tables.
45.Give users the required privileges.
46.Give user newUserName on computer computerName full privileges
47.Created and given full access to the firstdb database
48.Create a second access to the database, one with fewer privileges
49.To reset an existing limit to the default of no limit, specify a value of zero.
50.To specify an anonymous-user account, specify an empty string for the user part of the account name:
51.Specifying Resource Limits
52.The right to change access privileges.