MySQL database installation and basic operation

First, download and install about MySQL:

The first step, first go to the official website to download MySQL version they need, I have here the design to the 5.6 version.

The second step, after the download is complete, extract. MySQL will start the program in the bin directory under the MySQL files, configure the environment variable.

The third step is to start with cmd run as administrator, and then set the cost to MySQL service.

The fourth step, the program was officially launched at the input port cmd 'mysql -uroot -p'.

 

Second, some basic operations on MySQL:

1. The additions and deletions to change search on the library:

By: create database database name;

Delete: drop database database name;

Change: alter database library name charset = 'gbk';

查:show databases;

  show create database 库名;

2. With regard to additions and deletions to change search table:

Switch to the library: use library name

By: create table table name (field, field type constraints);

Delete: drop table table name;

Change: alter table modify table name field type field (number);

Charles: show tables;

  show create table 表名

  desc table

3. About recorded in the table CRUD:

By: insert into table values ​​(.....);

Delete: delete from table name where id = 1;

Change: update table set field = record;

Charles: select * from table name;

  select field from table;

 

Guess you like

Origin www.cnblogs.com/wujc3/p/11384867.html