You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.0 KiB
47 lines
1.0 KiB
# -*- coding: utf-8 -*-
|
|
import mysql.connector
|
|
|
|
# 连接到 MySQL 数据库
|
|
conn = mysql.connector.connect(
|
|
host="localhost", # 数据库主机地址
|
|
user="root", # 数据库用户名
|
|
password="123123", # 数据库密码
|
|
database='aerospace'
|
|
)
|
|
|
|
# 创建一个游标对象
|
|
cursor = conn.cursor()
|
|
|
|
# 创建表的 SQL 语句
|
|
create_table_query = """
|
|
CREATE TABLE igs_stations (
|
|
Site_Name VARCHAR(255),
|
|
Country_Region VARCHAR(255) ,
|
|
Receiver VARCHAR(255),
|
|
Antenna VARCHAR(255),
|
|
Radome VARCHAR(255),
|
|
Satellite_System VARCHAR(255),
|
|
Latitude VARCHAR(255),
|
|
Longitude VARCHAR(255) ,
|
|
Height_m VARCHAR(255),
|
|
X_m VARCHAR(255),
|
|
Y_m VARCHAR(255),
|
|
Z_m VARCHAR(255),
|
|
Calibration VARCHAR(255),
|
|
Networks VARCHAR(255),
|
|
Data_Center VARCHAR(255),
|
|
IERS_DOMES VARCHAR(255),
|
|
Clock VARCHAR(255),
|
|
Agencies VARCHAR(255),
|
|
Last_Data VARCHAR(255)
|
|
)
|
|
"""
|
|
|
|
# 执行创建表语句
|
|
cursor.execute(create_table_query)
|
|
|
|
# 提交更改
|
|
conn.commit()
|
|
|
|
# 关闭连接
|
|
conn.close() |