mysql --innodb_file_per_table

mysql --innodb_file_per_table

Ich habe eine einfache Frage zum Zugriff auf MySQL per Befehl. Als ich versuchte, als Root darauf zuzugreifen, wurde eine Meldung zurückgegeben:

mysql: unknown option '--innodb_file_per_table'

Wie würde es wieder zum Laufen gebracht werden?


Danke, Rick. Ich habe es geschafft, Zugriff zu erhalten und der Server funktioniert. Was mir Sorgen macht, sind die vielen Fehler beim Starten/Stoppen/Neustarten.

Fehlerprotokoll

2020-12-17 19:16:40 0 [Note] InnoDB: Using Linux native AIO
2020-12-17 19:16:40 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2020-12-17 19:16:40 0 [Note] InnoDB: Uses event mutexes
2020-12-17 19:16:40 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2020-12-17 19:16:40 0 [Note] InnoDB: Number of pools: 1
2020-12-17 19:16:40 0 [Note] InnoDB: Using SSE2 crc32 instructions
2020-12-17 19:16:40 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2020-12-17 19:16:40 0 [Note] InnoDB: Completed initialization of buffer pool
2020-12-17 19:16:40 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority       ().
2020-12-17 19:16:40 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2020-12-17 19:16:40 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2020-12-17 19:16:40 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2020-12-17 19:16:40 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2020-12-17 19:16:40 0 [Note] InnoDB: 10.3.27 started; log sequence number 8459955162; transaction id 23688770
2020-12-17 19:16:40 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool
2020-12-17 19:16:40 0 [Note] Plugin 'FEEDBACK' is disabled.
2020-12-17 19:16:40 0 [Note] Server socket created on IP: '127.0.0.1'.
2020-12-17 19:16:40 0 [Note] Reading of all Master_info entries succeeded
2020-12-17 19:16:40 0 [Note] Added new Master_info '' to hash table
2020-12-17 19:16:40 0 [Note] /usr/sbin/mysqld: ready for connections.
Version: '10.3.27-MariaDB-0+deb10u1'  socket: '/run/mysqld/mysqld.sock'  port: 3306  Debian 10
2020-12-17 19:16:40 0 [Note] InnoDB: Buffer pool(s) load completed at 201217 19:16:40

Antwort1

mysqldPlan A (chaotisch und nicht empfohlen): Fügen Sie diese Option (dem Serverprogramm, nicht mysqleinem Clientprogramm) hinzu .

Plan B: Ändern Sie die Einstellung in my.cnf(oder wo auch immer sich die Konfigurationsdatei befindet). Starten Sie dann den Server neu. (Der Neustart ist betriebssystemabhängig.)

Plan C: Melden Sie sich als MySQL-„Root“-Benutzer an und führen Sie Folgendes aus SET GLOBAL innodb_file_per_table = 1;. Von nun an (bis Sie sich abmelden) CREATEswerden Tabellen, die diese Verbindung verwenden, Datei für Tabelle sein. Da diese Einstellung „global“ ist, gilt sie auch für andere, die sich anmelden.nachtun SETundVordann der nächste Neustart (oder Sie schalten die Flagge aus).

Plan D: (Nur in MySQL 8.0) Root kann dies SETmit einer PERSISTOption tun. (Aber ich werde nicht ins Detail gehen.)

Vorbehalt: Verschiedene Einstellungen haben verschiedene Regeln. Diese 4 Pläne funktionieren fürmancheEinstellungen. Für andere Einstellungen gelten weniger oder mehr Pläne. Ein Hinweis ist, dass in der Dokumentation steht, ob die Einstellung „global“ oder „Sitzung“ oder beides ist.

verwandte Informationen