MySQL安裝和簡單操作

2022-08-19 16:18:11 字數 1600 閱讀 3735

mysql的安裝請參考下面這篇部落格,講述的非常詳細,各種截圖也很清晰。

大家可以安裝下面的這個部落格來進行一些簡單的mysql的操作,講得非常詳細,有語法和具體例項。

建立乙個表

書名 出版社

create table runoob_tbl(

runoob_id int not null auto_increment,

runoob_title varchar(100) not null,

runoob_author varchar(40) not null,

submission_date date,

primary key ( runoob_id )

);

在表裡插入資料

insert into runoob_tbl

(runoob_title, runoob_author, submission_date)

values

("學習 php", "菜鳥教程", now());

insert into runoob_tbl

(runoob_title, runoob_author, submission_date)

values

("學習 python", "菜鳥教程", now());

insert into runoob_tbl

(runoob_title, runoob_author, submission_date)

values

("學習 mysql", "菜鳥教程", now());

查詢表裡的資料

select * from runoob_tbl;

show databases;

create database example;

use example;

show databases;

create database example;

use example;

drop database example;

create database example;

use example;

建立乙個表,有以下屬性

id name author publish_date

create table book(

id int not null auto_increment,

name varchar(100)

not null,

author varchar(40) not null,

publish_date date,

primary key (

id )

);insert into book (name, author, publish_date) values ("learn

django", "yating","2016-09-01");

select * from book where name="learn mysql"

and id=1;

select name, author from book;

Ubuntu 安裝mysql和簡單操作

ubuntu上安裝mysql非常簡單只需要幾條命令就可以完成。1.sudo apt get install mysql server 2.apt get isntall mysql client 3.sudo apt get install libmysqlclient dev 安裝過程中會提示設定...

Ubuntu 安裝mysql和簡單操作

ubuntu上安裝mysql非常簡單只需要幾條命令就可以完成。1.sudo apt get install mysql server 2.sudo apt get install mysql client 3.sudo apt get install libmysqlclient dev 安裝過程中...

Ubuntu 安裝mysql和簡單操作

ubuntu上安裝mysql非常簡單只需要幾條命令就可以完成。1.sudo apt get install mysql server 2.apt get isntall mysql client 3.sudo apt get install libmysqlclient dev 安裝過程中會提示設定...