20180510 Morning Lesson Records 07-mysql

Source: Internet
Author: User

1.MySQL Create DB, delete DB command

Create database db;
drop database db;

field type of 2.MySQL
整型:tinyint,smallint,mediumint,int,bigint浮点型:float(m,d),double(m,d),decimal(m,d)字符串类型:char(n),varchar(n),tinytext,text,mediumtext,longtext日期和时间类型:date,time,datetime,timestamp,year枚举类型:enum(‘member1‘,‘member‘,...)参考:54982164
3. What is the syntax for building a table?
CREATE TABLE `tb_name` (  `id` int NOT NULL AUTO_INCREMENT,  `column1` xxx,  `column2` xxx,  PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8;
4. What is the tail of the normal syntax for a build table?

CREATE TABLE tb_name Start
Engine=innodb DEFAULT Charset=utf8; End

5. Talk about Insert syntax

Insert into Tb_name () values ();

6. Update syntax

Update tb_name set xxx= ' where xxxx= ';

7. Delete syntax

Delete from tb_name where xxxx= ';

8. See how many links MySQL has and what commands, how to kill? (not to confirm before killing)

Show Processlist;
Kill Id kills before killing to confirm

9. See what fields are in a table? Which two commands can be viewed

Desc Tb_name;
Show CREATE TABLE tb_name;

10. Allow user A to log in to the company's internal MySQL from any computer, ask what symbol identification

%

11. Create a DB and user permissions, what is the command of the password

GRANT all privileges in db . * to ' user ' @ '% ' identified by ' 123456 ';

12. About the operation of the user, permission, we have to knock on the last command, what is it? Flush Privileges;13.mysql-p 123456, right?

Wrong

14. What is the process of re-deploying MySQL?

Delete Arch and data directories
Perform scripts/mysql_install_db redeployment

15. Talk about your understanding of the MySQL character set

Database character set try to use UTF8 to reduce garbled characters

What are the commands for blurring view parameters in 16.mysql?

Show variables like '%xx% ';

20180510 Morning Lesson Records 07-mysql

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.