1. 程式人生 > >python學習之操作mysql01

python學習之操作mysql01

使用pip 安裝mysql  

pip install mysql

使用命令列開啟資料庫且選擇使用已有的資料庫

顯示已有資料庫show databases;

選擇已有資料庫

use s23;

顯示s23資料庫都有哪些表

show tables;

在命令下建立新表

create table user(
id int primary key auto_increment,
name varchar(32),
password varchar(32)
);

可以通過show tables發現,user新表已被新增進來了。