win10 MySQL shell的使用

MySQL shell的使用

1 .下載安裝

安裝完成之後再搜索欄中會有mysql shell
在這裏插入圖片描述

2開始使用shell

(1)連接數據庫

 MySQL  JS > \connect [email protected]

(2)使用sql語句

 MySQL  JS >\sql

(3)查看數據庫【注意;分號】

MySQL  127.0.0.1:33060+ ssl  SQL > show databases;                                                                                                        

(4)創建數據庫名字爲tyy

 MySQL  127.0.0.1:33060+ ssl  SQL > create database tyy;   

(5)使用數據庫

 MySQL  127.0.0.1:33060+ ssl  SQL > use  tyy;   

(6)創建表

 MySQL  127.0.0.1:33060+ ssl  tyy  SQL > create table user1(id int PRIMARY KEY,name varchar(20),passwd varchar(20)) ;  ``

在這裏插入圖片描述

2. 在pycharm中的使用

import pymysql
db = pymysql.connect(host="127.0.0.1",user="tyy",password="123456",database="tyy",charset="utf8") #連接數據庫成功

記得安裝

pip install cryptography

在這裏插入圖片描述
不然報錯
RuntimeError: cryptography is required for sha256_password or caching_sha2_p

發佈了4 篇原創文章 · 獲贊 3 · 訪問量 70
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章