Logo von Expert Mysql

Expert Mysql

Community
wonderslife
expert-mysql

MySQL-Datenbankexperte für SQL-Optimierung, Indexdesign und die Analyse von Tabellenstrukturen. Greift auf die offizielle MySQL-Dokumentation zurück. Rufen Sie diesen Skill auf, wenn Nutzer SQL optimieren, Datenbanken entwerfen oder Indizes optimieren möchten. 支持中文触发:SQL优化、数据库设计、索引优化、表结构分析、MySQL优化、查询优化。

Übersicht

Herausgeberwonderslife
Repositorypdd-skills
Skill-Nameexpert-mysql
Sterne
41
Forks
11
Mitgelieferte Dateien
Nur Anweisungen
LizenzMIT
Links
  • Anweisungen in Markdown

    Eine SKILL.md-Datei, die das Modell bei Bedarf lädt. So werden nur dann Token verbraucht, wenn eine Anfrage tatsächlich dazu passt.

  • Funktioniert mit jedem LLM

    KI-Skills bestehen aus reinem Markdown, nicht aus anbieterspezifischem Code. Daher funktionieren sie mit GPT, Claude, Gemini, Grok oder einem lokalen Modell.

  • In sich abgeschlossen

    Alles, was das Modell braucht, steht in den Anweisungen — keine zusätzlichen Dateien zum Synchronisieren.

  • Open Source

    Von wonderslife auf GitHub veröffentlicht. Prüfen Sie vor der Installation die Quelldateien.

Installation

Installieren Sie den KI-Skill Expert Mysql in TypingMind, um ihn mit jedem LLM zu nutzen, oder fügen Sie ihn einem anderen Agenten hinzu, der SKILL.md lesen kann.

1

In TypingMind installieren

TypingMind installiert einen Skill direkt aus seinem GitHub-Ordner. Dabei liest die App SKILL.md, bündelt die Ressourcendateien und speichert das Ergebnis lokal.

  1. Öffnen Sie die App und gehen Sie zu Plugins → Skills.
  2. Wählen Sie „Von GitHub installieren“.
  3. Fügen Sie die unten angegebene URL des Skill-Ordners ein und bestätigen Sie.
    https://github.com/wonderslife/pdd-skills/tree/main/expert-mysql
  4. Aktivieren Sie den Skill in jedem Chat, in dem er verfügbar sein soll.
Plugins → Skills → Skill hinzufügen → Über GitHub-URL. Fügen Sie dann die Ordner-URL ein und klicken Sie auf „Weiter“.
2

In einem anderen Agenten installieren

Jeder Agent, der das Agent-Skills-Format unterstützt, kann diesen Skill nutzen. Kopieren Sie den Ordner in das Skill-Verzeichnis des jeweiligen Agenten.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/wonderslife/pdd-skills.git /tmp/pdd-skills
mkdir -p .claude/skills
cp -r /tmp/pdd-skills/expert-mysql .claude/skills/expert-mysql
Starten Sie Claude Code nach dem Kopieren neu, damit der neue Skill erkannt wird.

In TypingMind verwenden

Aktivieren Sie Expert Mysql in einem beliebigen Chat in TypingMind. Den Rest übernimmt das Modell. Name und Beschreibung des Skills stehen im System-Prompt. Sobald eine Anfrage passt, lädt das Modell selbstständig die vollständigen Anweisungen — Sie müssen den Skill nie manuell aufrufen, und er verbraucht erst Token, wenn er tatsächlich genutzt wird.

Das Modell lädt Expert Mysql automatisch, sobald eine passende Anfrage gestellt wird.

Funktioniert mit jedem KI-Modell

KI-Skills bestehen aus reinen Markdown-Anweisungen statt aus anbieterspezifischem Code. Daher ist Expert Mysql nicht an das Modell gebunden, für das der Skill geschrieben wurde. Installieren Sie ihn einmal in TypingMind und nutzen Sie ihn mit GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder einem selbst betriebenen lokalen Modell — alles mit Ihren eigenen API-Schlüsseln.

  • Wird nur bei Bedarf geladen

    Der System-Prompt enthält nur den Namen und die Beschreibung. Die Anweisungen werden bei der ersten passenden Anfrage geladen. Ein ungenutzter Skill verursacht daher keine Kosten.

  • Modell im laufenden Chat wechseln

    Da der Skill aus Anweisungen statt aus Code besteht, funktioniert er auch nach einem Modellwechsel — das nächste Modell liest dieselbe SKILL.md-Datei.

Skill-Anweisungen

Dies ist der Inhalt von SKILL.md, den das Modell lädt. Lesen Sie ihn vor der Installation — ein Skill besteht aus Anweisungen, denen Ihr Modell folgt.

MySQL Database Expert

Overview

This skill provides professional MySQL database related services, including SQL query optimization, database table structure design, index optimization, stored procedure writing, etc. Provides authoritative technical support based on MySQL official documentation.

Directory Structure

expert-mysql/
├── SKILL.md              # Skill definition file
├── LICENSE               # MIT License
├── README.md             # Documentation
└── references/           # Reference documents
    ├── mysql80/          # MySQL 8.0 documentation summary
    └── mysql94/          # MySQL 9.4 documentation summary

Trigger Conditions

Auto Trigger:

  • User asks about SQL query optimization
  • Need to design or modify database table structure
  • Index related issues
  • Stored procedure writing
  • Database performance issue analysis

Manual Trigger:

  • User inputs commands like /mysql, /sql, /database, etc.

Core Capabilities

1. SQL Query Optimization

1.1 Query Analysis Tools

EXPLAIN Analysis:

sql
-- Basic usage
EXPLAIN SELECT * FROM users WHERE name = 'John';

-- Detailed analysis (MySQL 8.0.18+)
EXPLAIN ANALYZE SELECT * FROM users WHERE name = 'John';

EXPLAIN Output Interpretation:

ColumnDescriptionFocus Points
idQuery identifierSubquery order
select_typeQuery typeAvoid DEPENDENT SUBQUERY
tableTable nameJoin table order
typeAccess typeTarget: ref, range, index
possible_keysPossible indexes to use-
keyActually used indexWhether index is hit
key_lenIndex lengthShorter is better
rowsEstimated rows to scanFewer is better
ExtraAdditional informationAvoid Using filesort, Using temporary
1.2 Common Optimization Scenarios

**Scenario 1: Avoid SELECT ***

sql
-- Not recommended
SELECT * FROM orders WHERE status = 'pending';

-- Recommended
SELECT id, customer_id, total_amount 
FROM orders 
WHERE status = 'pending';

Scenario 2: Optimize JOIN

sql
-- Ensure join fields have indexes
CREATE INDEX idx_orders_customer_id ON orders(customer_id);

-- Use INNER JOIN instead of WHERE join
SELECT o.*, c.name 
FROM orders o
INNER JOIN customers c ON o.customer_id = c.id
WHERE o.status = 'pending';

Scenario 3: Subquery Optimization

sql
-- Not recommended: Correlated subquery
SELECT * FROM orders o1
WHERE total_amount > (
    SELECT AVG(total_amount) FROM orders o2 
    WHERE o2.customer_id = o1.customer_id
);

-- Recommended: JOIN + subquery
SELECT o.* 
FROM orders o
JOIN (
    SELECT customer_id, AVG(total_amount) as avg_amount
    FROM orders
    GROUP BY customer_id
) avg ON o.customer_id = avg.customer_id
WHERE o.total_amount > avg.avg_amount;

Scenario 4: Pagination Optimization

sql
-- Traditional pagination (slow with large data)
SELECT * FROM orders ORDER BY id LIMIT 10000, 20;

-- Optimized pagination (using index)
SELECT o.* FROM orders o
JOIN (SELECT id FROM orders ORDER BY id LIMIT 10000, 20) t
ON o.id = t.id;

2. Index Design

2.1 Index Types
TypeDescriptionUse Cases
PRIMARY KEYPrimary key indexUnique identifier
UNIQUEUnique indexUnique constraint
INDEXRegular indexAccelerate queries
FULLTEXTFull-text indexText search
SPATIALSpatial indexGeographic location
2.2 Index Design Principles
  1. Selectivity Principle: Prioritize columns with high selectivity

    sql
    -- Calculate selectivity
    SELECT COUNT(DISTINCT column_name) / COUNT(*) FROM table_name;
    -- Closer to 1 means higher selectivity
  2. Leftmost Prefix Principle: Composite index matches from left

    sql
    -- Composite index
    CREATE INDEX idx_name_status_create ON orders(customer_name, status, create_time);
    
    -- Hits index
    WHERE customer_name = 'John'
    WHERE customer_name = 'John' AND status = 'pending'
    
    -- Does not hit index
    WHERE status = 'pending'
  3. Covering Index Principle: Query fields are all in the index

    sql
    -- Covering index
    CREATE INDEX idx_covering ON orders(status, total_amount);
    
    -- Query only uses index columns
    SELECT status, total_amount FROM orders WHERE status = 'pending';
2.3 Index Invalidation Scenarios
ScenarioExampleSolution
Using functionsWHERE YEAR(create_time) = 2024Use range query instead
Implicit conversionWHERE phone = 13800138000 (string field)Add quotes
LIKE left wildcardWHERE name LIKE '%John'Use full-text index
OR conditionWHERE name = 'John' OR age = 20Use UNION
NOT conditionWHERE status != 'deleted'Use IN instead

3. Table Structure Design

3.1 Data Type Selection
TypeStorageRangeUse Cases
TINYINT1 byte-128~127Status, flags
SMALLINT2 bytes-32768~32767Counts, quantities
INT4 bytes-2.1B~2.1BPrimary key, ID
BIGINT8 bytesVery largeLarge data primary key
VARCHAR(n)Variablen charactersStrings
TEXTVariable64KBLong text
DATETIME8 bytes1000~9999 yearTime
TIMESTAMP4 bytes1970~2038 yearTimestamp
3.2 Normalization Design

First Normal Form (1NF): Fields are indivisible

Second Normal Form (2NF): Eliminate partial dependencies

sql
-- Does not conform to 2NF
CREATE TABLE orders (
    id INT,
    customer_id INT,
    customer_name VARCHAR(100),  -- Depends on customer_id
    product_id INT,
    product_name VARCHAR(100),   -- Depends on product_id
    PRIMARY KEY (id)
);

-- Conforms to 2NF
CREATE TABLE orders (
    id INT PRIMARY KEY,
    customer_id INT,
    product_id INT
);

CREATE TABLE customers (
    id INT PRIMARY KEY,
    name VARCHAR(100)
);

Third Normal Form (3NF): Eliminate transitive dependencies

3.3 Denormalization Design

Appropriate redundancy to improve query performance:

sql
-- Order table with redundant customer name
CREATE TABLE orders (
    id INT PRIMARY KEY,
    customer_id INT,
    customer_name VARCHAR(100),  -- Redundant field
    total_amount DECIMAL(10,2),
    create_time DATETIME
);

4. Performance Optimization

4.1 Slow Query Analysis
sql
-- Enable slow query log
SET GLOBAL slow_query_log = 'ON';
SET GLOBAL long_query_time = 2;  -- More than 2 seconds
SET GLOBAL slow_query_log_file = '/var/log/mysql/slow.log';

-- View slow queries
SELECT * FROM mysql.slow_log ORDER BY start_time DESC LIMIT 10;
4.2 Connection Pool Optimization
properties
# Recommended configuration
spring.datasource.hikari.maximum-pool-size=20
spring.datasource.hikari.minimum-idle=5
spring.datasource.hikari.idle-timeout=300000
spring.datasource.hikari.connection-timeout=30000
4.3 Cache Optimization
sql
-- Query cache (removed in MySQL 8.0, recommend using application layer cache)
-- Use Redis to cache hot data

5. Advanced Features

5.1 Window Functions (MySQL 8.0+)
sql
-- Ranking
SELECT 
    name,
    score,
    RANK() OVER (ORDER BY score DESC) as rank,
    DENSE_RANK() OVER (ORDER BY score DESC) as dense_rank,
    ROW_NUMBER() OVER (ORDER BY score DESC) as row_num
FROM students;

-- Grouped aggregation
SELECT 
    department,
    name,
    salary,
    AVG(salary) OVER (PARTITION BY department) as dept_avg,
    salary - AVG(salary) OVER (PARTITION BY department) as diff
FROM employees;
5.2 CTE Common Table Expressions (MySQL 8.0+)
sql
-- Non-recursive CTE
WITH monthly_sales AS (
    SELECT 
        DATE_FORMAT(order_date, '%Y-%m') as month,
        SUM(amount) as total
    FROM orders
    GROUP BY month
)
SELECT * FROM monthly_sales WHERE total > 10000;

-- Recursive CTE (hierarchical query)
WITH RECURSIVE org_tree AS (
    SELECT id, name, manager_id, 1 as level
    FROM employees WHERE manager_id IS NULL
    
    UNION ALL
    
    SELECT e.id, e.name, e.manager_id, t.level + 1
    FROM employees e
    JOIN org_tree t ON e.manager_id = t.id
)
SELECT * FROM org_tree;
5.3 JSON Support (MySQL 5.7+)
sql
-- Create JSON column
CREATE TABLE products (
    id INT PRIMARY KEY,
    name VARCHAR(100),
    attributes JSON
);

-- Insert JSON data
INSERT INTO products VALUES (1, 'iPhone', '{"color": "black", "storage": 128}');

-- Query JSON
SELECT name, attributes->>'$.color' as color FROM products;

-- JSON functions
SELECT 
    JSON_EXTRACT(attributes, '$.storage') as storage,
    JSON_SET(attributes, '$.price', 999) as with_price,
    JSON_REMOVE(attributes, '$.color') as no_color
FROM products;

6. Transaction Management

6.1 Transaction Isolation Levels
Isolation LevelDescriptionDirty ReadNon-repeatable ReadPhantom Read
READ UNCOMMITTEDRead uncommitted✗✗✗
READ COMMITTEDRead committed✓✗✗
REPEATABLE READRepeatable read (default)✓✓✗
SERIALIZABLESerializable✓✓✓

View current isolation level:

sql
SELECT @@transaction_isolation;

Set isolation level:

sql
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
6.2 Lock Mechanism

Lock Types:

Lock TypeDescriptionUse Cases
Shared Lock (S Lock)Allow read, block writeSELECT ... LOCK IN SHARE MODE
Exclusive Lock (X Lock)Block read and writeSELECT ... FOR UPDATE
Intention LockTable-level lock, indicates row lock intentAutomatically added
Gap LockLock range, prevent phantom readsREPEATABLE READ

Lock Examples:

sql
-- Shared lock
SELECT * FROM orders WHERE id = 1 LOCK IN SHARE MODE;

-- Exclusive lock
SELECT * FROM orders WHERE id = 1 FOR UPDATE;

-- View lock waits
SELECT * FROM information_schema.INNODB_LOCK_WAITS;
6.3 Deadlock Handling

Deadlock Detection:

sql
-- View deadlock information
SHOW ENGINE INNODB STATUS;

-- View lock waits
SELECT 
    r.trx_id waiting_trx_id,
    r.trx_mysql_thread_id waiting_thread,
    b.trx_id blocking_trx_id,
    b.trx_mysql_thread_id blocking_thread
FROM information_schema.INNODB_LOCK_WAITS w
JOIN information_schema.INNODB_TRX b ON b.trx_id = w.blocking_trx_id
JOIN information_schema.INNODB_TRX r ON r.trx_id = w.requesting_trx_id;

Deadlock Avoidance Recommendations:

  1. Access tables in the same order
  2. Avoid long transactions
  3. Use lower isolation levels
  4. Design indexes properly
6.4 Distributed Transactions

XA Transactions:

sql
-- Enable XA transaction
XA START 'xid1';
INSERT INTO orders VALUES (1, 'order1');
XA END 'xid1';
XA PREPARE 'xid1';
XA COMMIT 'xid1';

7. Master-Slave Replication

7.1 Master-Slave Architecture
Master Database
    ↓ Binary log
Slave1 Database  Slave2 Database  Slave3 Database
7.2 Master Configuration
ini
# my.cnf
[mysqld]
server-id = 1
log-bin = mysql-bin
binlog-format = ROW
binlog-do-db = mydb

Create replication user:

sql
CREATE USER 'repl'@'%' IDENTIFIED BY 'password';
GRANT REPLICATION SLAVE ON *.* TO 'repl'@'%';
FLUSH PRIVILEGES;
7.3 Slave Configuration
ini
# my.cnf
[mysqld]
server-id = 2
relay-log = mysql-relay-bin
read-only = 1

Configure replication:

sql
CHANGE MASTER TO
    MASTER_HOST='master_ip',
    MASTER_USER='repl',
    MASTER_PASSWORD='password',
    MASTER_LOG_FILE='mysql-bin.000001',
    MASTER_LOG_POS=154;

START SLAVE;
7.4 Read-Write Separation

Application Layer Configuration:

java
// Spring Boot configuration
@Configuration
public class DataSourceConfig {
    
    @Bean
    @Primary
    public DataSource masterDataSource() {
        return DataSourceBuilder.create()
            .url("jdbc:mysql://master:3306/mydb")
            .build();
    }
    
    @Bean
    public DataSource slaveDataSource() {
        return DataSourceBuilder.create()
            .url("jdbc:mysql://slave:3306/mydb")
            .build();
    }
    
    @Bean
    public RoutingDataSource routingDataSource() {
        Map<Object, Object> targetDataSources = new HashMap<>();
        targetDataSources.put("master", masterDataSource());
        targetDataSources.put("slave", slaveDataSource());
        
        RoutingDataSource routingDataSource = new RoutingDataSource();
        routingDataSource.setTargetDataSources(targetDataSources);
        routingDataSource.setDefaultTargetDataSource(masterDataSource());
        return routingDataSource;
    }
}
7.5 Replication Status Monitoring
sql
-- View master status
SHOW MASTER STATUS;

-- View slave status
SHOW SLAVE STATUS\G;

-- Key indicators
-- Slave_IO_Running: Yes
-- Slave_SQL_Running: Yes
-- Seconds_Behind_Master: 0

8. Backup and Recovery

8.1 Logical Backup

mysqldump Backup:

bash
# Backup single database
mysqldump -u root -p mydb > mydb_backup.sql

# Backup multiple databases
mysqldump -u root -p --databases db1 db2 > multi_db_backup.sql

# Backup all databases
mysqldump -u root -p --all-databases > all_db_backup.sql

# Backup table structure only
mysqldump -u root -p --no-data mydb > schema.sql

# Backup data only
mysqldump -u root -p --no-create-info mydb > data.sql

Logical Recovery:

bash
# Restore database
mysql -u root -p mydb < mydb_backup.sql

# Ignore errors during restore
mysql -u root -p -f mydb < mydb_backup.sql
8.2 Physical Backup

Percona XtraBackup:

bash
# Full backup
xtrabackup --backup --target-dir=/backup/full

# Incremental backup
xtrabackup --backup --target-dir=/backup/inc1 \
    --incremental-basedir=/backup/full

# Prepare for recovery
xtrabackup --prepare --target-dir=/backup/full

# Restore data
xtrabackup --copy-back --target-dir=/backup/full
8.3 Backup Strategy
StrategyDescriptionUse Cases
Full backupComplete backup of all dataWeekly
Incremental backupBackup changed data onlyDaily
Binary log backupBackup operation logsReal-time backup
Hybrid backupFull + incremental + logsRecommended for production
8.4 Point-in-Time Recovery
bash
# 1. Restore full backup
mysql -u root -p < full_backup.sql

# 2. Apply binary logs
mysqlbinlog --start-datetime="2024-01-01 00:00:00" \
            --stop-datetime="2024-01-01 12:00:00" \
            mysql-bin.000001 | mysql -u root -p
8.5 Automatic Backup Script
bash
#!/bin/bash
# MySQL automatic backup script

BACKUP_DIR="/backup/mysql"
DATE=$(date +%Y%m%d_%H%M%S)
DB_NAME="mydb"
DB_USER="backup"
DB_PASS="password"

# Create backup directory
mkdir -p $BACKUP_DIR

# Execute backup
mysqldump -u$DB_USER -p$DB_PASS --single-transaction \
    --routines --triggers --events $DB_NAME \
    | gzip > $BACKUP_DIR/${DB_NAME}_${DATE}.sql.gz

# Delete backups older than 7 days
find $BACKUP_DIR -name "*.sql.gz" -mtime +7 -delete

# Log
echo "Backup completed: ${DB_NAME}_${DATE}.sql.gz" >> $BACKUP_DIR/backup.log

9. Partitioned Tables

9.1 Partition Types
TypeDescriptionUse Cases
RANGERange partitioningDate range, numeric range
LISTList partitioningDiscrete values, regional classification
HASHHash partitioningEvenly distribute data
KEYKey partitioningSimilar to HASH, supports multiple columns
9.2 Partitioned Table Examples

RANGE Partitioning:

sql
CREATE TABLE orders (
    id BIGINT,
    order_date DATE,
    customer_id INT,
    amount DECIMAL(10,2),
    PRIMARY KEY (id, order_date)
) PARTITION BY RANGE (YEAR(order_date)) (
    PARTITION p2022 VALUES LESS THAN (2023),
    PARTITION p2023 VALUES LESS THAN (2024),
    PARTITION p2024 VALUES LESS THAN (2025),
    PARTITION pmax VALUES LESS THAN MAXVALUE
);

LIST Partitioning:

sql
CREATE TABLE customers (
    id INT,
    name VARCHAR(100),
    region VARCHAR(50),
    PRIMARY KEY (id, region)
) PARTITION BY LIST (region) (
    PARTITION p_north VALUES IN ('Beijing', 'Tianjin', 'Hebei'),
    PARTITION p_south VALUES IN ('Guangdong', 'Guangxi', 'Hainan'),
    PARTITION p_east VALUES IN ('Shanghai', 'Jiangsu', 'Zhejiang'),
    PARTITION p_west VALUES IN ('Sichuan', 'Chongqing', 'Yunnan')
);

HASH Partitioning:

sql
CREATE TABLE logs (
    id BIGINT AUTO_INCREMENT,
    user_id INT,
    action VARCHAR(50),
    created_at DATETIME,
    PRIMARY KEY (id)
) PARTITION BY HASH(user_id) PARTITIONS 10;
9.3 Partition Management
sql
-- Add partition
ALTER TABLE orders ADD PARTITION (
    PARTITION p2025 VALUES LESS THAN (2026)
);

-- Drop partition (data will also be deleted)
ALTER TABLE orders DROP PARTITION p2022;

-- Merge partitions
ALTER TABLE orders REORGANIZE PARTITION p2023, p2024 INTO (
    PARTITION p2023_2024 VALUES LESS THAN (2025)
);

-- View partition information
SELECT * FROM information_schema.PARTITIONS 
WHERE TABLE_NAME = 'orders';

Usage Examples

Example 1: Query Optimization

User: This query is slow, how to optimize?
SELECT * FROM orders WHERE YEAR(create_time) = 2024 AND status = 'pending'

Expert: Problem analysis:
1. YEAR() function causes index invalidation
2. SELECT * returns unnecessary fields

Optimization solution:
SELECT id, customer_id, total_amount, status
FROM orders 
WHERE create_time >= '2024-01-01' 
  AND create_time < '2025-01-01'
  AND status = 'pending';

Suggested index:
CREATE INDEX idx_status_create ON orders(status, create_time);

Example 2: Index Design

User: What indexes does this table need?
CREATE TABLE orders (
    id BIGINT PRIMARY KEY,
    customer_id BIGINT,
    status VARCHAR(20),
    create_time DATETIME,
    total_amount DECIMAL(10,2)
);

Expert: Suggested indexes:

1. Customer query index:
   CREATE INDEX idx_customer ON orders(customer_id);

2. Status + time composite index (covers common queries):
   CREATE INDEX idx_status_create ON orders(status, create_time);

3. Amount range query index:
   CREATE INDEX idx_amount ON orders(total_amount);

Note: Adjust index order based on actual query patterns

Example 3: Table Structure Optimization

User: Is this table design reasonable?
CREATE TABLE user_orders (
    id INT,
    user_id INT,
    user_name VARCHAR(50),
    user_phone VARCHAR(20),
    order_no VARCHAR(50),
    product_name VARCHAR(100),
    product_price DECIMAL(10,2),
    create_time DATETIME
);

Expert: The following issues exist:

1. Violates second normal form: user_name, user_phone depend on user_id
2. Violates second normal form: product_name, product_price depend on product_id
3. Missing primary key constraint
4. Missing foreign key constraint

Optimization solution:
-- Users table
CREATE TABLE users (
    id INT PRIMARY KEY AUTO_INCREMENT,
    name VARCHAR(50),
    phone VARCHAR(20)
);

-- Products table
CREATE TABLE products (
    id INT PRIMARY KEY AUTO_INCREMENT,
    name VARCHAR(100),
    price DECIMAL(10,2)
);

-- Orders table
CREATE TABLE orders (
    id INT PRIMARY KEY AUTO_INCREMENT,
    user_id INT,
    product_id INT,
    order_no VARCHAR(50) UNIQUE,
    create_time DATETIME,
    FOREIGN KEY (user_id) REFERENCES users(id),
    FOREIGN KEY (product_id) REFERENCES products(id)
);

Guardrails

  • Must provide suggestions based on MySQL official documentation
  • Optimization solutions need to consider version compatibility
  • Provided SQL must be syntax validated
  • Large table operations need to provide batch processing suggestions
  • Uncertain issues must be clearly stated

Related Resources

Häufig gestellte Fragen

Was macht der KI-Skill Expert Mysql?

MySQL-Datenbankexperte für SQL-Optimierung, Indexdesign und die Analyse von Tabellenstrukturen. Greift auf die offizielle MySQL-Dokumentation zurück. Rufen Sie diesen Skill auf, wenn Nutzer SQL optimieren, Datenbanken entwerfen oder Indizes optimieren möchten. 支持中文触发:SQL优化、数据库设计、索引优化、表结构分析、MySQL优化、查询优化。

Warum Expert Mysql in TypingMind nutzen?

Weil Sie den Skill einmal installieren und mit jedem Modell verwenden können. Expert Mysql besteht aus reinem Markdown statt aus anbieterspezifischem Code. So funktioniert derselbe Skill mit GPT-5, Claude, Gemini, Grok oder einem lokalen Modell – und Sie können das Modell mitten im Chat wechseln, ohne dass der Skill seine Funktion verliert. TypingMind verwendet Ihre eigenen API-Schlüssel. Sie bezahlen die Anbieter daher direkt statt über ein Abonnement pro Nutzerplatz, und Ihre Skills und Chats bleiben in Ihrem eigenen Speicher.

Wie installiere ich Expert Mysql in TypingMind?

Öffnen Sie in TypingMind Plugins → Skills → Von GitHub installieren und fügen Sie https://github.com/wonderslife/pdd-skills/tree/main/expert-mysql ein. TypingMind liest die Datei SKILL.md und installiert den Skill, den Sie für jeden Chat einzeln aktivieren können.

Welche KI-Modelle können Expert Mysql nutzen?

Jedes Modell, das Sie mit TypingMind verbinden. KI-Skills bestehen aus reinen Markdown-Anweisungen statt aus anbieterspezifischem Code. Daher können GPT, Claude, Gemini, Grok und lokale Modelle diesen Skill laden, wenn eine Anfrage dazu passt.

Wie viele KI-Modelle kann ich mit Expert Mysql verwenden?

So viele Sie möchten. In TypingMind können Sie Expert Mysql mit jedem Modell verwenden, das Skills unterstützt, etwa mit GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama. Dabei nutzen Sie Ihre eigenen API-Schlüssel.

Ist der KI-Skill Expert Mysql kostenlos?

Ja. Der Skill wird von wonderslife auf GitHub unter der Lizenz MIT veröffentlicht. Sie bezahlen nur Ihren eigenen KI-Anbieter für die verwendeten Token.

Was sind KI-Skills?

Ein KI-Skill ist ein wiederverwendbares Anweisungspaket, das einem KI-Modell vermittelt, wie es eine bestimmte Aufgabe erledigt. Es folgt dem offenen Format Agent Skills: Die Datei SKILL.md enthält den Namen und die Beschreibung des Skills. Hinzu kommen bei Bedarf Skripte, Vorlagen oder Referenzdateien für das Modell. Das Modell liest die Anweisungen nur, wenn Ihre Anfrage zum Skill passt. Ein installierter Skill verursacht daher erst Kosten, wenn er verwendet wird.

Wie unterscheiden sich KI-Skills von Plugins oder MCP-Servern?

Ein Plugin oder MCP-Server stellt einem Modell neue aufrufbare Tools bereit – Code, der auf einem System ausgeführt wird und ein Ergebnis zurückgibt. Ein KI-Skill vermittelt dem Modell stattdessen Wissen und Vorgehensweisen: wie es eine Aufgabe angeht, welche Schritte es befolgt und wie eine gute Ausgabe aussieht. Skills bestehen aus reinem Markdown und kommen daher ohne Server, API-Schlüssel und Laufzeitumgebung aus. Sie funktionieren mit jedem Modell.

Alle anzeigen

Jetzt eigenen KI-Arbeitsbereich einrichten

Abonnieren Sie unseren Newsletter und erfahren Sie mehr über neue Funktionen und kommende Gewinnspiele 👇