国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

【Python】Python進階系列教程-- Python3 MySQL - mysql-connector 驅(qū)動(三)

這篇具有很好參考價值的文章主要介紹了【Python】Python進階系列教程-- Python3 MySQL - mysql-connector 驅(qū)動(三)。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點擊"舉報違法"按鈕提交疑問。

前言

往期回顧:

  • Python進階系列教程-- Python3 正則表達(dá)式(一)
  • Python進階系列教程-- Python3 CGI編程(二)

本章節(jié)我們?yōu)榇蠹医榻B使用 mysql-connector 來連接使用 MySQL, mysql-connector 是 MySQL 官方提供的驅(qū)動器。

我們可以使用 pip 命令來安裝 mysql-connector:

python -m pip install mysql-connector

使用以下代碼測試 mysql-connector 是否安裝成功:

demo_mysql_test.py:

import mysql.connector

執(zhí)行以上代碼,如果沒有產(chǎn)生錯誤,表明安裝成功。

注意:如果你的 MySQL 是 8.0 版本,密碼插件驗證方式發(fā)生了變化,早期版本為 mysql_native_password,8.0 版本為 caching_sha2_password,所以需要做些改變:

先修改 my.ini 配置:

[mysqld]
default_authentication_plugin=mysql_native_password

然后在 mysql 下執(zhí)行以下命令來修改密碼:

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '新密碼';

更多內(nèi)容可以參考:Python MySQL8.0 鏈接問題。

創(chuàng)建數(shù)據(jù)庫連接

可以使用以下代碼來連接數(shù)據(jù)庫:

demo_mysql_test.py:
import mysql.connector
 
mydb = mysql.connector.connect(
  host="localhost",       # 數(shù)據(jù)庫主機地址
  user="yourusername",    # 數(shù)據(jù)庫用戶名
  passwd="yourpassword"   # 數(shù)據(jù)庫密碼
)
 
print(mydb)

創(chuàng)建數(shù)據(jù)庫

創(chuàng)建數(shù)據(jù)庫使用 “CREATE DATABASE” 語句,以下創(chuàng)建一個名為 demo_db 的數(shù)據(jù)庫:

demo_mysql_test.py:

import mysql.connector
 
mydb = mysql.connector.connect(
  host="localhost",
  user="root",
  passwd="123456"
)
 
mycursor = mydb.cursor()
 
mycursor.execute("CREATE DATABASE demo_db ")

創(chuàng)建數(shù)據(jù)庫前我們也可以使用 “SHOW DATABASES” 語句來查看數(shù)據(jù)庫是否存在:

demo_mysql_test.py:
輸出所有數(shù)據(jù)庫列表:

import mysql.connector
 
mydb = mysql.connector.connect(
  host="localhost",
  user="root",
  passwd="123456"
)
 
mycursor = mydb.cursor()
 
mycursor.execute("SHOW DATABASES")
 
for x in mycursor:
  print(x)

或者我們可以直接連接數(shù)據(jù)庫,如果數(shù)據(jù)庫不存在,會輸出錯誤信息:

demo_mysql_test.py:

import mysql.connector
 
mydb = mysql.connector.connect(
  host="localhost",
  user="root",
  passwd="123456",
  database="demo_db"
)

創(chuàng)建數(shù)據(jù)表

創(chuàng)建數(shù)據(jù)表使用 “CREATE TABLE” 語句,創(chuàng)建數(shù)據(jù)表前,需要確保數(shù)據(jù)庫已存在,以下創(chuàng)建一個名為 sites 的數(shù)據(jù)表:

demo_mysql_test.py:

import mysql.connector
 
mydb = mysql.connector.connect(
  host="localhost",
  user="root",
  passwd="123456",
  database="demo_db"
)
mycursor = mydb.cursor()
 
mycursor.execute("CREATE TABLE sites (name VARCHAR(255), url VARCHAR(255))")

執(zhí)行成功后,我們可以看到數(shù)據(jù)庫創(chuàng)建的數(shù)據(jù)表 sites,字段為 name 和 url。

mysql-connector-python,# Python,python,mysql,開發(fā)語言

我們也可以使用 “SHOW TABLES” 語句來查看數(shù)據(jù)表是否已存在:
demo_mysql_test.py:

import mysql.connector
 
mydb = mysql.connector.connect(
  host="localhost",
  user="root",
  passwd="123456",
  database="demo_db"
)
mycursor = mydb.cursor()
 
mycursor.execute("SHOW TABLES")
 
for x in mycursor:
  print(x)

主鍵設(shè)置

創(chuàng)建表的時候我們一般都會設(shè)置一個主鍵(PRIMARY KEY),我們可以使用 “INT AUTO_INCREMENT PRIMARY KEY” 語句來創(chuàng)建一個主鍵,主鍵起始值為 1,逐步遞增。

如果我們的表已經(jīng)創(chuàng)建,我們需要使用 ALTER TABLE 來給表添加主鍵:

demo_mysql_test.py:
給 sites 表添加主鍵。

import mysql.connector
 
mydb = mysql.connector.connect(
  host="localhost",
  user="root",
  passwd="123456",
  database="demo_db"
)
mycursor = mydb.cursor()
 
mycursor.execute("ALTER TABLE sites ADD COLUMN id INT AUTO_INCREMENT PRIMARY KEY")

如果你還未創(chuàng)建 sites 表,可以直接使用以下代碼創(chuàng)建。

demo_mysql_test.py:
給表創(chuàng)建主鍵。

import mysql.connector
 
mydb = mysql.connector.connect(
  host="localhost",
  user="root",
  passwd="123456",
  database="demo_db"
)
mycursor = mydb.cursor()
 
mycursor.execute("CREATE TABLE sites (id INT AUTO_INCREMENT PRIMARY KEY, name VARCHAR(255), url VARCHAR(255))")

插入數(shù)據(jù)

插入數(shù)據(jù)使用 “INSERT INTO” 語句:

demo_mysql_test.py:
向 sites 表插入一條記錄。

import mysql.connector
 
mydb = mysql.connector.connect(
  host="localhost",
  user="root",
  passwd="123456",
  database="demo_db"
)
mycursor = mydb.cursor()
 
sql = "INSERT INTO sites (name, url) VALUES (%s, %s)"
val = ("demo", "https://www.demo.com")
mycursor.execute(sql, val)
 
mydb.commit()    # 數(shù)據(jù)表內(nèi)容有更新,必須使用到該語句
 
print(mycursor.rowcount, "記錄插入成功。")

執(zhí)行代碼,輸出結(jié)果為:

1 記錄插入成功

批量插入

批量插入使用 executemany() 方法,該方法的第二個參數(shù)是一個元組列表,包含了我們要插入的數(shù)據(jù):

demo_mysql_test.py:
向 sites 表插入多條記錄。

import mysql.connector
 
mydb = mysql.connector.connect(
  host="localhost",
  user="root",
  passwd="123456",
  database="demo_db"
)
mycursor = mydb.cursor()
 
sql = "INSERT INTO sites (name, url) VALUES (%s, %s)"
val = [
  ('Google', 'https://www.google.com'),
  ('Github', 'https://www.github.com'),
  ('Taobao', 'https://www.taobao.com'),
  ('stackoverflow', 'https://www.stackoverflow.com/')
]
 
mycursor.executemany(sql, val)
 
mydb.commit()    # 數(shù)據(jù)表內(nèi)容有更新,必須使用到該語句
 
print(mycursor.rowcount, "記錄插入成功。")

執(zhí)行代碼,輸出結(jié)果為:

4 記錄插入成功。

執(zhí)行以上代碼后,我們可以看看數(shù)據(jù)表的記錄:
mysql-connector-python,# Python,python,mysql,開發(fā)語言

如果我們想在數(shù)據(jù)記錄插入后,獲取該記錄的 ID ,可以使用以下代碼:

demo_mysql_test.py:

import mysql.connector
 
mydb = mysql.connector.connect(
  host="localhost",
  user="root",
  passwd="123456",
  database="demo_db"
)
mycursor = mydb.cursor()
 
sql = "INSERT INTO sites (name, url) VALUES (%s, %s)"
val = ("Zhihu", "https://www.zhihu.com")
mycursor.execute(sql, val)
 
mydb.commit()
 
print("1 條記錄已插入, ID:", mycursor.lastrowid)

執(zhí)行代碼,輸出結(jié)果為:

1 條記錄已插入, ID: 6

查詢數(shù)據(jù)

查詢數(shù)據(jù)使用 SELECT 語句:

demo_mysql_test.py:
import mysql.connector
 
mydb = mysql.connector.connect(
  host="localhost",
  user="root",
  passwd="123456",
  database="demo_db"
)
mycursor = mydb.cursor()
 
mycursor.execute("SELECT * FROM sites")
 
myresult = mycursor.fetchall()     # fetchall() 獲取所有記錄
 
for x in myresult:
  print(x)

執(zhí)行代碼,輸出結(jié)果為:

(1, 'DEMO', 'https://www.demo.com')
(2, 'Google', 'https://www.google.com')
(3, 'Github', 'https://www.github.com')
(4, 'Taobao', 'https://www.taobao.com')
(5, 'stackoverflow', 'https://www.stackoverflow.com/')
(6, 'Zhihu', 'https://www.zhihu.com')

也可以讀取指定的字段數(shù)據(jù):

demo_mysql_test.py:

import mysql.connector
 
mydb = mysql.connector.connect(
  host="localhost",
  user="root",
  passwd="123456",
  database="demo_db"
)
mycursor = mydb.cursor()
 
mycursor.execute("SELECT name, url FROM sites")
 
myresult = mycursor.fetchall()
 
for x in myresult:
  print(x)

執(zhí)行代碼,輸出結(jié)果為:

('DEMO', 'https://www.demo.com')
('Google', 'https://www.google.com')
('Github', 'https://www.github.com')
('Taobao', 'https://www.taobao.com')
('stackoverflow', 'https://www.stackoverflow.com/')
('Zhihu', 'https://www.zhihu.com')

如果我們只想讀取一條數(shù)據(jù),可以使用 fetchone() 方法:

demo_mysql_test.py:

import mysql.connector
 
mydb = mysql.connector.connect(
  host="localhost",
  user="root",
  passwd="123456",
  database="demo_db"
)
mycursor = mydb.cursor()
 
mycursor.execute("SELECT * FROM sites")
 
myresult = mycursor.fetchone()
 
print(myresult)

執(zhí)行代碼,輸出結(jié)果為:

(1, 'DEMO', 'https://www.demo.com')

where 條件語句

如果我們要讀取指定條件的數(shù)據(jù),可以使用 where 語句:

demo_mysql_test.py
讀取 name 字段為 DEMO的記錄:

import mysql.connector
 
mydb = mysql.connector.connect(
  host="localhost",
  user="root",
  passwd="123456",
  database="demo_db"
)
mycursor = mydb.cursor()
 
sql = "SELECT * FROM sites WHERE name ='DEMO'"
 
mycursor.execute(sql)
 
myresult = mycursor.fetchall()
 
for x in myresult:
  print(x)

執(zhí)行代碼,輸出結(jié)果為:

(1, 'DEMO', 'https://www.demo.com')

也可以使用通配符 %:

demo_mysql_test.py文章來源地址http://www.zghlxwxcb.cn/news/detail-704761.html

import mysql.connector
 
mydb = mysql.connector.connect(
  host="localhost",
  user="root",
  passwd="123456",
  database="demo_db"
)
mycursor = mydb.cursor()
 
sql = "SELECT * FROM sites WHERE url LIKE '%oo%'"
 
mycursor.execute(sql)
 
myresult = mycursor.fetchall()
 
for x in myresult:
  print(x)

執(zhí)行代碼,輸出結(jié)果為:

(1, 'DEMO', 'https://www.demo.com')
(2, 'Google', 'https://www.google.com')

為了防止數(shù)據(jù)庫查詢發(fā)生 SQL 注入的攻擊,我們可以使用 %s 占位符來轉(zhuǎn)義查詢的條件:

demo_mysql_test.py

import mysql.connector
 
mydb = mysql.connector.connect(
  host="localhost",
  user="root",
  passwd="123456",
  database="demo_db"
)
mycursor = mydb.cursor()
 
sql = "SELECT * FROM sites WHERE name = %s"
na = ("DEMO", )
 
mycursor.execute(sql, na)
 
myresult = mycursor.fetchall()
 
for x in myresult:
  print(x)

排序

查詢結(jié)果排序可以使用 ORDER BY 語句,默認(rèn)的排序方式為升序,關(guān)鍵字為 ASC,如果要設(shè)置降序排序,可以設(shè)置關(guān)鍵字 DESC。

demo_mysql_test.py
按 name 字段字母的升序排序:

import mysql.connector
 
mydb = mysql.connector.connect(
  host="localhost",
  user="root",
  passwd="123456",
  database="demo_db"
)
mycursor = mydb.cursor()
 
sql = "SELECT * FROM sites ORDER BY name"
 
mycursor.execute(sql)
 
myresult = mycursor.fetchall()
 
for x in myresult:
  print(x)

執(zhí)行代碼,輸出結(jié)果為:

(3, 'Github', 'https://www.github.com')
(2, 'Google', 'https://www.google.com')
(1, 'DEMO', 'https://www.demo.com')
(5, 'stackoverflow', 'https://www.stackoverflow.com/')
(4, 'Taobao', 'https://www.taobao.com')
(6, 'Zhihu', 'https://www.zhihu.com')

降序排序?qū)嵗?/p>

demo_mysql_test.py
按 name 字段字母的降序排序:

import mysql.connector
 
mydb = mysql.connector.connect(
  host="localhost",
  user="root",
  passwd="123456",
  database="demo_db"
)
mycursor = mydb.cursor()
 
sql = "SELECT * FROM sites ORDER BY name DESC"
 
mycursor.execute(sql)
 
myresult = mycursor.fetchall()
 
for x in myresult:
  print(x)

執(zhí)行代碼,輸出結(jié)果為:

(6, 'Zhihu', 'https://www.zhihu.com')
(4, 'Taobao', 'https://www.taobao.com')
(5, 'stackoverflow', 'https://www.stackoverflow.com/')
(1, 'DEMO', 'https://www.demo.com')
(2, 'Google', 'https://www.google.com')
(3, 'Github', 'https://www.github.com')

Limit

如果我們要設(shè)置查詢的數(shù)據(jù)量,可以通過 “LIMIT” 語句來指定

demo_mysql_test.py
讀取前 3 條記錄:

import mysql.connector
 
mydb = mysql.connector.connect(
  host="localhost",
  user="root",
  passwd="123456",
  database="demo_db"
)
mycursor = mydb.cursor()
 
mycursor.execute("SELECT * FROM sites LIMIT 3")
 
myresult = mycursor.fetchall()
 
for x in myresult:
  print(x)

執(zhí)行代碼,輸出結(jié)果為:

(1, 'DEMO', 'https://www.demo.com')
(2, 'Google', 'https://www.google.com')
(3, 'Github', 'https://www.github.com')

也可以指定起始位置,使用的關(guān)鍵字是 OFFSET:

demo_mysql_test.py
從第二條開始讀取前 3 條記錄:

import mysql.connector
 
mydb = mysql.connector.connect(
  host="localhost",
  user="root",
  passwd="123456",
  database="demo_db"
)
mycursor = mydb.cursor()
 
mycursor.execute("SELECT * FROM sites LIMIT 3 OFFSET 1")  # 0 為 第一條,1 為第二條,以此類推
 
myresult = mycursor.fetchall()
 
for x in myresult:
  print(x)

執(zhí)行代碼,輸出結(jié)果為:

(2, 'Google', 'https://www.google.com')
(3, 'Github', 'https://www.github.com')
(4, 'Taobao', 'https://www.taobao.com')

刪除記錄

刪除記錄使用 “DELETE FROM” 語句:

demo_mysql_test.py
刪除 name 為 stackoverflow 的記錄:

import mysql.connector
 
mydb = mysql.connector.connect(
  host="localhost",
  user="root",
  passwd="123456",
  database="demo_db"
)
mycursor = mydb.cursor()
 
sql = "DELETE FROM sites WHERE name = 'stackoverflow'"
 
mycursor.execute(sql)
 
mydb.commit()
 
print(mycursor.rowcount, " 條記錄刪除")

執(zhí)行代碼,輸出結(jié)果為:

1  條記錄刪除

注意:要慎重使用刪除語句,刪除語句要確保指定了 WHERE 條件語句,否則會導(dǎo)致整表數(shù)據(jù)被刪除。

為了防止數(shù)據(jù)庫查詢發(fā)生 SQL 注入的攻擊,我們可以使用 %s 占位符來轉(zhuǎn)義刪除語句的條件:

demo_mysql_test.py

import mysql.connector
 
mydb = mysql.connector.connect(
  host="localhost",
  user="root",
  passwd="123456",
  database="demo_db"
)
mycursor = mydb.cursor()
 
sql = "DELETE FROM sites WHERE name = %s"
na = ("stackoverflow", )
 
mycursor.execute(sql, na)
 
mydb.commit()
 
print(mycursor.rowcount, " 條記錄刪除")

執(zhí)行代碼,輸出結(jié)果為:

1  條記錄刪除

更新表數(shù)據(jù)

數(shù)據(jù)表更新使用 “UPDATE” 語句:

demo_mysql_test.py
將 name 為 Zhihu 的字段數(shù)據(jù)改為 ZH:

import mysql.connector
 
mydb = mysql.connector.connect(
  host="localhost",
  user="root",
  passwd="123456",
  database="demo_db"
)
mycursor = mydb.cursor()
 
sql = "UPDATE sites SET name = 'ZH' WHERE name = 'Zhihu'"
 
mycursor.execute(sql)
 
mydb.commit()
 
print(mycursor.rowcount, " 條記錄被修改")

執(zhí)行代碼,輸出結(jié)果為:

1  條記錄被修改

注意:UPDATE 語句要確保指定了 WHERE 條件語句,否則會導(dǎo)致整表數(shù)據(jù)被更新。

為了防止數(shù)據(jù)庫查詢發(fā)生 SQL 注入的攻擊,我們可以使用 %s 占位符來轉(zhuǎn)義更新語句的條件:

demo_mysql_test.py

import mysql.connector
 
mydb = mysql.connector.connect(
  host="localhost",
  user="root",
  passwd="123456",
  database="demo_db"
)
mycursor = mydb.cursor()
 
sql = "UPDATE sites SET name = %s WHERE name = %s"
val = ("Zhihu", "ZH")
 
mycursor.execute(sql, val)
 
mydb.commit()
 
print(mycursor.rowcount, " 條記錄被修改")

執(zhí)行代碼,輸出結(jié)果為:

1  條記錄被修改

刪除表

刪除表使用 “DROP TABLE” 語句, IF EXISTS 關(guān)鍵字是用于判斷表是否存在,只有在存在的情況才刪除:

demo_mysql_test.py

import mysql.connector
 
mydb = mysql.connector.connect(
  host="localhost",
  user="root",
  passwd="123456",
  database="demo_db"
)
mycursor = mydb.cursor()
 
sql = "DROP TABLE IF EXISTS sites"  # 刪除數(shù)據(jù)表 sites
 
mycursor.execute(sql)

到了這里,關(guān)于【Python】Python進階系列教程-- Python3 MySQL - mysql-connector 驅(qū)動(三)的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實不符,請點擊違法舉報進行投訴反饋,一經(jīng)查實,立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費用

相關(guān)文章

  • 【已解決】Could not find artifact mysql:mysql-connector

    今天遇到個問題困擾了我20分鐘,我最終解決了他,寫下此篇博客。原問題是: 在pom.xml文件中指定你的mysql版本。 便可解決此問題了。親自驗證。

    2024年02月11日
    瀏覽(16)
  • 【Python】Python系列教程-- Python3 集合(十五)

    往期回顧: Python系列教程–Python3介紹(一) Python系列教程–Python3 環(huán)境搭建(二) Python系列教程–Python3 VScode(三) Python系列教程–Python3 基礎(chǔ)語法(四) Python系列教程–Python3 基本數(shù)據(jù)類型(五) Python系列教程-- Python3 數(shù)據(jù)類型轉(zhuǎn)換(六) Python系列教程-- Python3 推導(dǎo)式(

    2024年02月07日
    瀏覽(21)
  • 【Python】Python系列教程--Python3 環(huán)境搭建(二)

    【Python】Python系列教程--Python3 環(huán)境搭建(二)

    往期回顧: Python系列教程–Python3介紹(一) Python3 可應(yīng)用于多平臺包括 Windows、Linux 和 Mac OS X。 Unix (Solaris, Linux, FreeBSD, AIX, HP/UX, SunOS, IRIX, 等等。) Win 9x/NT/2000 Macintosh (Intel, PPC, 68K) OS/2 DOS (多個DOS版本) PalmOS Nokia 移動手機 Windows CE Acorn/RISC OS BeOS Amiga VMS/OpenVMS QNX VxWorks Psion Pyt

    2024年02月07日
    瀏覽(21)
  • 【Python】Python系列教程-- Python3 推導(dǎo)式(七)

    往期回顧: Python系列教程–Python3介紹(一) Python系列教程–Python3 環(huán)境搭建(二) Python系列教程–Python3 VScode(三) Python系列教程–Python3 基礎(chǔ)語法(四) Python系列教程–Python3 基本數(shù)據(jù)類型(五) Python系列教程-- Python3 數(shù)據(jù)類型轉(zhuǎn)換(六) Python 推導(dǎo)式是一種獨特的數(shù)據(jù)處

    2024年02月07日
    瀏覽(41)
  • 【Python】Python系列教程-- Python3 數(shù)據(jù)類型轉(zhuǎn)換(六)

    往期回顧: Python系列教程–Python3介紹(一) Python系列教程–Python3 環(huán)境搭建(二) Python系列教程–Python3 VScode(三) Python系列教程–Python3 基礎(chǔ)語法(四) Python系列教程–Python3 基本數(shù)據(jù)類型(五) 有時候,我們需要對數(shù)據(jù)內(nèi)置的類型進行轉(zhuǎn)換,數(shù)據(jù)類型的轉(zhuǎn)換,一般情況

    2024年02月08日
    瀏覽(23)
  • 【Python】Python系列教程-- Python3 迭代器與生成器(二十)

    往期回顧: Python系列教程–Python3介紹(一) Python系列教程–Python3 環(huán)境搭建(二) Python系列教程–Python3 VScode(三) Python系列教程–Python3 基礎(chǔ)語法(四) Python系列教程–Python3 基本數(shù)據(jù)類型(五) Python系列教程-- Python3 數(shù)據(jù)類型轉(zhuǎn)換(六) Python系列教程-- Python3 推導(dǎo)式(

    2024年02月08日
    瀏覽(86)
  • python3使用pymsql操作mysql數(shù)據(jù)庫

    python3使用pymsql操作mysql數(shù)據(jù)庫

    操作系統(tǒng) :Windows 10_x64 python版本 :3.9.2 pymysql版本: 1.0.2 MySQL版本: 5.7.38 ? 之前寫過一篇關(guān)于python操作mysql數(shù)據(jù)庫的文章: https://www.cnblogs.com/MikeZhang/p/pythonOptMysql20170703.html 當(dāng)時是基于python 2.7 和 mysql 5.5來整理的,但目前python 2.7已經(jīng)不再維護,主流的是python 3,今天基于pyt

    2024年02月05日
    瀏覽(29)
  • python3使用pandas備份mysql數(shù)據(jù)表

    python3使用pandas備份mysql數(shù)據(jù)表

    操作系統(tǒng) :CentOS 7.6_x64 Python版本:3.9.12 MySQL版本:5.7.38 日常開發(fā)過程中,會遇到mysql數(shù)據(jù)表的備份需求,需要針對單獨的數(shù)據(jù)表進行備份并定時清理數(shù)據(jù)。 今天記錄下python3如何使用pandas進行mysql數(shù)據(jù)表的備份,我將從以下幾個方面進行展開: ?數(shù)據(jù)表備份邏輯描述 ?使用的

    2024年02月05日
    瀏覽(48)
  • 大數(shù)據(jù)——Superset安裝篇(二)Python3.8環(huán)境+MySQL元數(shù)據(jù)庫

    安裝最新版本 1)安裝python3.8環(huán)境 使用 Miniconda3-latest-Linux-x86_64 腳本完成 conda包管理器的安裝 2)conda環(huán)境、包管理器常用命令 命令 說明 conda create -n env_name 創(chuàng)建環(huán)境 conda remove -n env_name --all 刪除一個環(huán)境 conda info --envs 查看所有環(huán)境 conda activate env_name 激活 或 切換 env_name環(huán)境

    2024年02月02日
    瀏覽(33)
  • 【Python】Python進階系列教程-- MongoDB(十二)

    往期回顧: Python進階系列教程-- Python3 正則表達(dá)式(一) Python進階系列教程-- Python3 CGI編程(二) Python進階系列教程-- Python3 MySQL - mysql-connector 驅(qū)動(三) Python進階系列教程-- Python3 MySQL 數(shù)據(jù)庫連接 - PyMySQL 驅(qū)動 Python進階系列教程-- Python3 網(wǎng)絡(luò)編程(五) Python進階系列教程

    2024年02月09日
    瀏覽(44)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包