English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Appunti di studio MySQL: motore di dati

Visualizza i motori di archiviazione supportati nel database corrente

show engines
+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+
| Engine       | Support | Commento                            | Transazioni | XA  | Punti di salvataggio |
+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+
| InnoDB       | DEFAULT | Supporta transazioni, locking a livello di riga e foreign key | YES     | YES | YES    |
| MRG_MYISAM     | YES   | Raccolta di tabelle MyISAM identiche             | NO      | NO  | NO     |
| MEMORY       | YES   | Basato su hash, memorizzato in memoria, utile per tabelle temporanee   | NO      | NO  | NO     |
| BLACKHOLE     | YES   | Motore di archiviazione /dev/null (ogni cosa che scrivi su di esso scompare) | NO      | NO  | NO     |
| MyISAM       | YES   | Motore di archiviazione MyISAM             | NO      | NO  | NO     |
| CSV        | YES   | Motore di archiviazione CSV                 | NO      | NO  | NO     |
| ARCHIVE      | YES   | Motore di archiviazione                     | NO      | NO  | NO     |
| PERFORMANCE_SCHEMA | YES   | Performance Schema                       | NO      | NO  | NO     |
| FEDERATED     | NO   | Federated MySQL storage engine                 | NULL     | NULL | NULL    |
+--------------------+---------+----------------------------------------------------------------+--------------+------+------------+
9 righe in set (0.00 sec)

oppure

show engines \G
mysql> show engines \G
*************************** 1. row ***************************
   Engine: InnoDB
   Support: DEFAULT
   Comment: Supports transactions, row-level locking, and foreign keys
Transactions: YES
     XA: YES
 Savepoints: YES
*************************** 2. row ***************************
   Engine: MRG_MYISAM
   Supporto: YES
   Comment: Collection of identical MyISAM tables
Transactions: NO
     XA: NO
 Savepoints: NO
*************************** 3. row ***************************
   Engine: MEMORY
   Supporto: YES
   Comment: Hash based, stored in memory, useful for temporary tables
Transactions: NO
     XA: NO
 Savepoints: NO
*************************** 4. row ***************************
   Engine: BLACKHOLE
   Supporto: YES
   Comment: /dev/null storage engine (anything you write to it disappears)
Transactions: NO
     XA: NO
 Savepoints: NO
*************************** 5. riga ***************************
   Engine: MyISAM
   Supporto: YES
   Commento: motore di archiviazione MyISAM
Transactions: NO
     XA: NO
 Savepoints: NO
*************************** 6. riga ***************************
   Engine: CSV
   Supporto: YES
   Commento: motore di archiviazione CSV
Transactions: NO
     XA: NO
 Savepoints: NO
*************************** 7. riga ***************************
   Engine: ARCHIVE
   Supporto: YES
   Commento: motore di archiviazione Archive
Transactions: NO
     XA: NO
 Savepoints: NO
*************************** 8. riga ***************************
   Engine: PERFORMANCE_SCHEMA
   Supporto: YES
   Commento: Schema delle prestazioni
Transactions: NO
     XA: NO
 Savepoints: NO
*************************** 9. riga ***************************
   Engine: FEDERATED
   Supporto: NO
   Commento: motore di archiviazione Federated MySQL
Transactions: NULL
     XA: NULL
 Savepoints: NULL
9 righe in set (0.00 sec)

Nome motore il nome dell'engine
Supporto se supporta YES indica il supporto, NO indica il non supporto
Commento valutazione o nota Defalut indica il motore di supporto predefinito
Transactions se supportano le transazioni, YES indica il supporto, NO indica il non supporto
XA Se tutti i distribuiti supportati sono conformi allo standard XA, YES indica il supporto, NO indica il non supporto
Savepoints se supportano i punti di salvataggio nelle transazioni, YES indica il supporto, NO indica il non supporto

oppure

show variables like 'have%'

mysql> show variables like 'have%';
+------------------------+----------+
| Nome_variabile     | Valore  |
+------------------------+----------+
| have_compress     | YES   |
| have_crypt       | NO    |
| have_dynamic_loading  | YES   |
| have_geometry     | YES   |
| have_openssl      | DISABLED |
| have_profiling     | YES   |
| have_query_cache    | YES   |
| have_rtree_keys    | YES   |
| have_ssl        | DISABLED |
| have_statement_timeout | YES   |
| have_symlink      | YES   |
+------------------------+----------+
11 righe in set, 1 avviso (0.00 sec)

Nome_variabile Nome motore
il valore supporta YES supporta, NO non supporta, DISABLED indica che supporta ma non è attivato

visualizzare il motore predefinito

show variables like ‘%storage_engine%’

mysql> show variables like '%storage_engine%';
+----------------------------------+--------+
| Nome_variabile          | Valore |
+----------------------------------+--------+
| default_storage_engine      | InnoDB |
| default_tmp_storage_engine    | InnoDB |
| disabled_storage_engines     |    |
| internal_tmp_disk_storage_engine | InnoDB |
+----------------------------------+--------+
4 righe in set, 1 avviso (0.00 sec)

InnoDB è il motore predefinito

modificare il motore predefinito

file my.ini

[mysqld]
# Le tre opzioni successive sono esclusive tra loro rispetto a SERVER_PORT di seguito.
# skip-networking
# enable-named-pipe
# shared-memory
# shared-memory-base-name=MYSQL
# Il tubo che il server MySQL utilizzerà
# socket=MYSQL
# Il numero di porta TCP/IP che il server MySQL ascolterà su Porta predefinita
port=3306
# Percorso alla directory di installazione. Tutti i percorsi sono risolti relativamente a questo. Directory di installazione predefinita del server
# basedir="C:/Program Files/MySQL/MySQL Server 5.7/"
# Percorso alla radice del database  Directory dei file di dati del database
datadir=C:/ProgramData/MySQL/MySQL Server 5.7\Data
# Il set di caratteri predefinito che verrà utilizzato quando viene creato un nuovo schema o tavolo
# Creato e non è definito un set di caratteri Modifica il set di caratteri predefinito del server
character-set-server=utf8
# Il motore di archiviazione predefinito che verrà utilizzato quando vengono creati nuovi tavoli quando
# Modifica il motore di archiviazione predefinito
default-storage-engine=INNODB

Riavvia il servizio MySQL dopo la modifica

Ti potrebbe interessare