In mysql, null, not null, default, and auto_increment are common content. Here I will detail the usage of null, not null, default, and auto_increment in msyql.
NULL and not null modifiers:
You can add the NULL or not null modifier after each field
In MySQL, each field definition contains additional constraints or modifiers that can be used to increase the constraints on the input data. Today, let's take a look at MySQL field constraints:NULLAndNot
NULL and NOT NULL modifiers:
You can add this null or NOT NULL modifier to each field to specify whether the field can be empty (null), or you must fill in the data (not NULL). mysql specifies null modifiers by default, and if a field is specified
1. New User:
>create USER name identified by ' Ssapdrow ';
2. Change Password:
>set PASSWORD for Name=password (' FDDDFD ');
3. Rights Management
>show GRANTS for name; View name User Rights
>grant SELECT on db_name.* to name; All permissions to
0. User management:1. New User:>create USER name identified by ' Ssapdrow ';2. Change Password:>set PASSWORD for Name=password (' FDDDFD ');3. Rights Management>show GRANTS for name; View name User Rights>grant SELECT on db_name.* to name; All
User management:1. Create a new User:>create user name identified by ' RedPen ';2. Change your password:>set Password for Name=password (' ddd ');3. Rights Management:>show grants for username; View name User Rights>grant Select on Db_name.*to name;
0. User management:1. New User:>create USER name identified by ' Ssapdrow ';2. Change Password:>set PASSWORD for Name=password (' FDDDFD ');3. Rights Management>show GRANTS for name; View name User Rights>grant SELECT on db_name.* to name; All
Reprint: http://www.cnblogs.com/picaso/archive/2012/05/17/2505895.html0. User management:1. New User:>create USER name identified by ' Ssapdrow ';2. Change Password:>set PASSWORD for Name=password (' FDDDFD ');3. Rights Management>show GRANTS for
0. User management:1. New User:>create USER name identified by ' Ssapdrow ';2. Change Password:>set PASSWORD for Name=password (' FDDDFD ');3. Rights Management>show GRANTS for name; View name User Rights>grant SELECT on db_name.* to name; All
ddl-Data Definition language (create,alter,drop,declare)dml-Data Manipulation Language (Select,delete,update,insert)dcl-Data Control Language (Grant,revoke,commit,rollback) First, a brief introduction to the underlying statement: 1, Description:
Zero. User Management:
1. Create a user:
> Create user name identified by 'ssapdrow ';
2. Change the password:
> Set password for name = PASSWORD ('fdddfd ');
3. permission management
> Show grants for name; // view the name user permission
> Grant
Sort the add, delete, modify, and query statements involved in mysql.
1. Create a user:
> Create user name identified by 'ssapdrow ';
2. Change the password:
> Set password for name = PASSWORD ('fdddfd ');
3. permission management
> Show grants for
Database operation Mysql 1. create a user:
> Create user name identified by 'ssapdrow ';
2. change the password:
> Set password for name = PASSWORD ('fdddfd ');
3. permission management
> Show grants for name; // view the name user permission
>
0. User management:1. New User:>create USER name identified by ' Ssapdrow ';2. Change Password:>set PASSWORD for Name=password (' FDDDFD ');3. Rights Management>show GRANTS for name; View name User Rights>grant SELECT on db_name.* to name; All
The recent interview encountered a database statement, found themselves in this area almost forget the light, so immediately go to the online review.0. User management:1. New User:>create USER name identified by ' Ssapdrow ';2. Change Password:>set
0. User management:1. New User:>create USER name identified by ' Ssapdrow ';2. Change Password:>set PASSWORD for Name=password (' FDDDFD ');3. Rights Management>show GRANTS for name; View name User Rights>grant SELECT on db_name.* to name; All
User management:1. New User:>create USER name identified by ' Ssapdrow ';2. Change Password:>set PASSWORD for Name=password (' FDDDFD ');3. Rights Management>show GRANTS for name; View name User Rights>grant SELECT on db_name.* to name; All
0. User management:1. New User:>create USER name identified by ' Ssapdrow ';2. Change Password:>set PASSWORD for Name=password (' FDDDFD ');3. Rights Management>show GRANTS for name; View name User Rights>grant SELECT on db_name.* to name; All
First, user management:1. New User:
>create USER name identified by ' Ssapdrow ';
2. Change Password:
>set PASSWORD for Name=password (' FDDDFD ');
3. Rights Management
>show GRANTS for name; View name User Rights
>
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.