suchen
HeimDatenbankMySQL-TutorialInstallieren Sie die Glibc-Version MySQL 5.7.12 basierend auf Linux


Für die Installation der MySQL-Datenbank stehen uns viele Optionen zur Verfügung. Die am häufigsten verwendeten sind die Binärinstallation und die Quellcodeinstallation. Die binäre Installationsmethode umfasst die RPM-Version und die Glibc-Version. Die RPM-Version wird unter einer bestimmten Linux-Version kompiliert. Wenn Ihre Linux-Version übereinstimmt, können Sie sie beispielsweise installieren. Wenn Sie ein RPM-Paket für RedHat6 oder RedHat7 kompiliert haben, laden Sie einfach die entsprechende Installation herunter. Es gibt ein weiteres binäres Installationspaket, das auf einer bestimmten Glibc-Version kompiliert wurde. In diesem Artikel wird hauptsächlich die Installation von MySQL auf Basis von Glibc beschrieben.

1. Bereiten Sie die Installationsumgebung vor

###准备安装介质下载地址:http://mirrors.sohu.com/mysql/MySQL-5.7/mysql-5.7.12-linux-glibc2.5-x86_64.tar.gz ###或者使用wget方式直接下载对应的版本
# wget http://www.php.cn/# mkdir -pv /u01/app# mkdir -pv /u01/soft# mkdir -pv /u02/mysqldata# cd /u01/soft# wget http://www.php.cn/ 
# tar -xf mysql-5.7.12-linux-glibc2.5-x86_64.tar.gz# ln -sv /u01/soft/mysql-5.7.12-linux-glibc2.5-x86_64 /u01/app/mysql`/u01/app/mysql' -> `
/u01/soft/mysql-5.7.12-linux-glibc2.5-x86_64'###下面添加mysql用户# useradd -r mysql -s /sbin/nologin# chown -R mysql:mysql /u01/app/mysql
# chown -R mysql:mysql /u02/mysqldata

2. Initialisieren Sie MySQL

###使用以下的方式来初始化# cd /u01/app/mysql/bin# ./mysqld --initialize --basedir=/u01/app/mysql --datadir=/u02/mysqldata --user=mysql 
--explicit_defaults_for_timestamp2016-06-28T02:18:23.437852Z 0 [Warning] InnoDB: New log files created, LSN=457902016-06-28T02:18:23.718104Z 0 
[Warning] InnoDB: Creating foreign key constraint system tables.2016-06-28T02:18:23.866501Z 0 [Warning] No existing UUID has been found, 
so we assume that this is the first time that this
     server has been started. Generating a new UUID: 9731b834-3cd6-11e6-8654-fcaa14e34b30.2016-06-28T02:18:23.896540Z 0 
     [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.2016-06-28T02:18:23.898416Z 
     1 [Note] A temporary password is generated for root@localhost: )%%D0pr,mU.Y# ls /u02/mysqldata/auto.cnf    client-cert.pem  
     ibdata1      performance_schema  sys
ca-key.pem  client-key.pem   ib_logfile0  server-cert.pem
ca.pem      client-req.pem   ib_logfile1  server-key.pem
ca-req.pem  ib_buffer_pool   mysql        server-req.pem###从上面的结果可以看出 mysql 5.7多出了证书相关文件,安全较5.6有较大提升
###mysql_install_db方式初始化数据已经被废弃# ./mysql_install_db --basedir=/u01/app/mysql --datadir=/u02/mysqldata --user=mysql2016-06-28 10:04:56 
[WARNING] mysql_install_db is deprecated. 
Please consider switching to mysqld --initialize2016-06-28 10:05:15 [WARNING] The bootstrap log isn't empty:2016-06-28 10:05:15 [WARNING] 
2016-06-28T02:04:56.688237Z 0 [Warning] --bootstrap is deprecated. Please consider using --initialize instead2016-06-28T02:04:56.688654Z 0 
[Warning] Changed limits: max_open_files: 1024 (requested 5000)2016-06-28T02:04:56.688657Z 0 [Warning] Changed 
limits: table_open_cache: 431 (requested 2000)###如上书提示,mysql_install_db方式初始化数据已经被废弃,建议使用mysqld --initialize,同时也给出了参数限制的警告
# cp /u01/app/mysql/support-files/my-default.cnf /etc/my.cnf# cp /u01/app/mysql/support-files/mysql.server /etc/init.d/mysqld# vim /etc/my.cnf [mysqld]
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
basedir=/u01/app/mysql
datadir=/u02/mysqldata
user=mysql
port=3306# vim /etc/profile.d/mysql.shexport MYSQL_HOME=/u01/app/mysql
export PATH=$PATH:$MYSQL_HOME/bin# source /etc/profile.d/mysql.sh# service mysqld startStarting MySQL.                                            [  OK  ]

3. Konfigurieren Sie die Sicherheitsoptionen

###使用初始化时得到的密码配置安全选项
# /u01/app/mysql/bin/mysql_secure_installation -p)%%D0pr,mU.Y
mysql_secure_installation: [Warning] Using a password on the command line interface can be insecure.

Securing the MySQL server deployment.

The existing password for the user account root has expired. Please set a new password.

New password: 

Re-enter new password: 

VALIDATE PASSWORD PLUGIN can be used to test passwordsand improve security. It checks the strength of passwordand allows the users to set 
only those passwords which aresecure enough. Would you like to setup VALIDATE PASSWORD plugin?

Press y|Y for Yes, any other key for No: y   ###是否校验密码插件

There are three levels of password validation policy:

LOW    Length >= 8MEDIUM Length >= 8, numeric, mixed case, and special characters
STRONG Length >= 8, numeric, mixed case, special characters and dictionary file

Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: 2  ###设定密码策略等级Using existing password for root.

Estimated strength of the password: 100 Change the password for root ? ((Press y|Y for Yes, any other key for No) : 

 ... skipping.By default, a MySQL installation has an anonymous user,
allowing anyone to log into MySQL without having to have
a user account created for them. This is intended only fortesting, and to make the installation go a bit smoother.
You should remove them before moving into a production
environment.

Remove anonymous users? (Press y|Y for Yes, any other key for No) : y  ###是否移除匿名用户
Success.

Normally, root should only be allowed to connect from'localhost'. This ensures that someone cannot guess atthe root password from the network.

Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y  ###是否关闭root远程登陆功能
Success.By default, MySQL comes with a database named 'test' that
anyone can access. This is also intended only for testing,and should be removed before moving into a production
environment.

Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y  ###是否移除测试数据库
 - Dropping test database... 
Success.

 - Removing privileges on test database...
Success.

Reloading the privilege tables will ensure that all changes
made so far will take effect immediately.

Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y  ###是否立即生效权限表
Success.All done! 

###以下为安全增强相关的部分参数

mysql> show variables like 'valid%';+--------------------------------------+--------+| Variable_name                   | Value  |
+--------------------------------------+--------+| validate_password_dictionary_file    |        |
| validate_password_length             | 8      |
| validate_password_mixed_case_count   | 1      |
| validate_password_number_count       | 1      |
| validate_password_policy             | STRONG |
| validate_password_special_char_count | 1      |
+--------------------------------------+--------+

4. Andere Instanzen auf demselben Host konfigurieren

###按上面描述的步骤创建其对应的目录及授权后,再执行初始化###使用新的配置文件,如下文本示例使用的为3317# mkdir -pv /u02/mysqldata3317# chown -R mysql:mysql 
/u02/mysqldata 3317# grep -v ^# /etc/my3317.cnf[mysqld]
basedir=/u01/app/mysql
datadir=/u02/mysqldata3317
user=mysql
port=3317socket=/tmp/mysql3317.sock# cd /u01/app/mysql/bin# ./mysqld --defaults-file=/etc/my3317.cnf --initialize --user=mysql 
--explicit_defaults_for_timestamp# 2016-06-30T08:32:52.497519Z 0 [Warning] InnoDB: New log files created, LSN=457902016-06-30T08:32:52.852457Z 0 
[Warning] InnoDB: Creating foreign key constraint system tables.2016-06-30T08:32:53.042621Z 0 [Warning] No existing UUID has been found, 
so we assume that this is the first time that this server has been started.
   Generating a new UUID: 3cb1686d-3e9d-11e6-a71f-fcaa14e34b30.2016-06-30T08:32:53.081210Z 0 [Warning] Gtid table is not ready to be used. 
Table 'mysql.gtid_executed' cannot be opened.2016-06-30T08:32:53.082538Z 1 [Note] A temporary password is generated for root@localhost: :8
#l!MCYoCNY### Author : Leshami### Blog   : http://www.php.cn/# mysqld_safe --defaults-file=/etc/my3317.cnf &[1] 58252016-06-30T08:11:49.468176Z 
mysqld_safe Logging to '/u02/mysqldata3317/ydq4.err'.2016-06-30T08:11:49.480379Z mysqld_safe The file /usr/local/mysql/bin/mysqld
does not exist or is not executable. Please cd to the mysql installation
directory and restart this script from there as follows:
./bin/mysqld_safe&
See http://dev.mysql.com/doc/mysql/en/mysqld-safe.html for more information###如果执行mysqld_safe出现上述错误,可以创建软链。
这个地方有问题,对于安装在非缺省目录时出现了这个问题。# mkdir -pv /usr/local/mysql/bin/# ln -sv /u01/app/mysql/bin/mysqld /usr/local/mysql/bin/mysqld
      "/usr/local/mysql/bin/mysqld" -> "/u01/app/mysql/bin/mysqld"# ./mysqld_safe --defaults-file=/etc/my3317.cnf &[1] 82872016-06-30T08:38:38.455961Z
       mysqld_safe Logging to '/u02/mysqldata3317/ydq4.err'.2016-06-30T08:38:38.471542Z mysqld_safe Starting mysqld daemon with databases from 
       /u02/mysqldata3317###配置安全选项# /u01/app/mysql/bin/mysql_secure_installation -P3317 -S /tmp/mysql3317.sock -p

5. Weitere MySQL-Installations- und Deinstallationsreferenzen


Installieren von MySQL 5.6 unter Linux 5 (RPM Methode)
MySQL 5 unter Linux deinstallieren
MySQL 5.6 basierend auf dem Quellcode unter Linux installieren
Die vollständige Version des MySQL-Quellcodes unter Linux installieren
Einige Hinweise zur Installation des MySQL-Quellcodes scr.rpm

Für die Installation der MySQL-Datenbank stehen uns viele Optionen zur Verfügung. Die am häufigsten verwendeten sind die Binärinstallation und die Quellcodeinstallation. Die binäre Installationsmethode umfasst die RPM-Version und die Glibc-Version. Die RPM-Version wird unter einer bestimmten Linux-Version kompiliert. Wenn Ihre Linux-Version übereinstimmt, können Sie sie beispielsweise installieren. Wenn Sie ein RPM-Paket für RedHat6 oder RedHat7 kompiliert haben, laden Sie einfach die entsprechende Installation herunter. Es gibt ein weiteres binäres Installationspaket, das auf einer bestimmten Glibc-Version kompiliert wurde. In diesem Artikel wird hauptsächlich die Installation von MySQL basierend auf Glibc beschrieben.

1. Bereiten Sie die Installationsumgebung vor

###准备安装介质下载地址:http://mirrors.sohu.com/mysql/MySQL-5.7/mysql-5.7.12-linux-glibc2.5-x86_64.tar.gz ###或者使用wget方式直接下载对应的版本
# wget http://www.php.cn/# mkdir -pv /u01/app# mkdir -pv /u01/soft# mkdir -pv /u02/mysqldata# cd /u01/soft# wget http://www.php.cn/ 
# tar -xf mysql-5.7.12-linux-glibc2.5-x86_64.tar.gz# ln -sv /u01/soft/mysql-5.7.12-linux-glibc2.5-x86_64 /u01/app/mysql`/u01/app/mysql' -> `
/u01/soft/mysql-5.7.12-linux-glibc2.5-x86_64'###下面添加mysql用户# useradd -r mysql -s /sbin/nologin# chown -R mysql:mysql /u01/app/mysql
# chown -R mysql:mysql /u02/mysqldata

2. Initialisieren Sie MySQL

###使用以下的方式来初始化# cd /u01/app/mysql/bin# ./mysqld --initialize --basedir=/u01/app/mysql --datadir=/u02/mysqldata 
--user=mysql --explicit_defaults_for_timestamp2016-06-28T02:18:23.437852Z 0 [Warning] InnoDB: New log files created,LSN=457902016-06-28T02:18:23.718104Z 0 
[Warning] InnoDB: Creating foreign key constraint system tables.2016-06-28T02:18:23.866501Z 0 [Warning] 
No existing UUID has been found, so we assume that this is 
the first time that this
     server has been started. Generating a new UUID: 9731b834-3cd6-11e6-8654-fcaa14e34b30.2016-06-28T02:18:23.896540Z 0 
     [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.2016-06-28T02:18:23.898416Z 1 [Note] A 
     temporary password is generated for root@localhost: )%%D0pr,mU.Y# ls /u02/mysqldata/auto.cnf client-cert.pem ibdata1 performance_schema sys
ca-key.pem  client-key.pem   ib_logfile0  server-cert.pem
ca.pem      client-req.pem   ib_logfile1  server-key.pem
ca-req.pem  ib_buffer_pool   mysql        server-req.pem###从上面的结果可以看出 mysql 5.7多出了证书相关文件,安全较5.6有较大提升
###mysql_install_db方式初始化数据已经被废弃# ./mysql_install_db --basedir=/u01/app/mysql --datadir=/u02/mysqldata --user=mysql2016-06-28 10:04:56 [WARNING] 
mysql_install_db is deprecated. 
Please consider switching to mysqld --initialize2016-06-28 10:05:15 [WARNING] The bootstrap log isn't empty:2016-06-28 10:05:15 [WARNING] 
2016-06-28T02:04:56.688237Z 0 [Warning] --bootstrap is deprecated. Please consider using --initialize instead2016-06-28T02:04:56.688654Z 0 [Warning] 
Changed limits: max_open_files: 1024 (requested 5000)2016-06-28T02:04:56.688657Z 0 [Warning] Changed limits: table_open_cache: 431 (requested 2000)
###如上书提示,mysql_install_db方式初始化数据已经被废弃,建议使用mysqld --initialize,同时也给出了参数限制的警告
# cp /u01/app/mysql/support-files/my-default.cnf /etc/my.cnf# cp /u01/app/mysql/support-files/mysql.server /etc/init.d/mysqld# vim /etc/my.cnf [mysqld]
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
basedir=/u01/app/mysql
datadir=/u02/mysqldata
user=mysql
port=3306# vim /etc/profile.d/mysql.shexport MYSQL_HOME=/u01/app/mysql
export PATH=$PATH:$MYSQL_HOME/bin# source /etc/profile.d/mysql.sh# service mysqld startStarting MySQL.                                        
    [  OK  ]

3. Konfigurieren Sie die Sicherheitsoptionen

###使用初始化时得到的密码配置安全选项
# /u01/app/mysql/bin/mysql_secure_installation -p)%%D0pr,mU.Y
mysql_secure_installation: [Warning] Using a password on the command line interface can be insecure.

Securing the MySQL server deployment.

The existing password for the user account root has expired. Please set a new password.

New password: 

Re-enter new password: 

VALIDATE PASSWORD PLUGIN can be used to test passwordsand improve security. It checks the strength of passwordand allows the users to set 
only those passwords which aresecure enough. Would you like to setup VALIDATE PASSWORD plugin?

Press y|Y for Yes, any other key for No: y   ###是否校验密码插件

There are three levels of password validation policy:

LOW    Length >= 8MEDIUM Length >= 8, numeric, mixed case, and special characters
STRONG Length >= 8, numeric, mixed case, special characters and dictionary file

Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: 2  ###设定密码策略等级Using existing password for root.

Estimated strength of the password: 100 Change the password for root ? ((Press y|Y for Yes, any other key for No) : 

 ... skipping.By default, a MySQL installation has an anonymous user,
allowing anyone to log into MySQL without having to have
a user account created for them. This is intended only fortesting, and to make the installation go a bit smoother.
You should remove them before moving into a production
environment.

Remove anonymous users? (Press y|Y for Yes, any other key for No) : y  ###是否移除匿名用户
Success.

Normally, root should only be allowed to connect from'localhost'. This ensures that someone cannot guess atthe root password from the network.

Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y  ###是否关闭root远程登陆功能
Success.By default, MySQL comes with a database named 'test' that
anyone can access. This is also intended only for testing,and should be removed before moving into a production
environment.

Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y  ###是否移除测试数据库
 - Dropping test database... 
Success.

 - Removing privileges on test database...
Success.

Reloading the privilege tables will ensure that all changes
made so far will take effect immediately.

Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y  ###是否立即生效权限表
Success.All done! 

###以下为安全增强相关的部分参数

mysql> show variables like 'valid%';+--------------------------------------+--------+| Variable_name                        | Value  |
+--------------------------------------+--------+| validate_password_dictionary_file    |        |
| validate_password_length             | 8      |
| validate_password_mixed_case_count   | 1      |
| validate_password_number_count       | 1      |
| validate_password_policy             | STRONG |
| validate_password_special_char_count | 1      |
+--------------------------------------+--------+

4. Konfigurieren Sie andere Instanzen auf demselben Host

###按上面描述的步骤创建其对应的目录及授权后,再执行初始化###使用新的配置文件,如下文本示例使用的为3317# mkdir -pv /u02/mysqldata3317
# chown -R mysql:mysql /u02/mysqldata 3317# grep -v ^# /etc/my3317.cnf[mysqld]
basedir=/u01/app/mysql
datadir=/u02/mysqldata3317
user=mysql
port=3317socket=/tmp/mysql3317.sock# cd /u01/app/mysql/bin# ./mysqld --defaults-file=/etc/my3317.cnf 
--initialize --user=mysql --explicit_defaults_for_timestamp
# 2016-06-30T08:32:52.497519Z 0 [Warning] InnoDB: New log files created, LSN=457902016-06-30T08:32:52.852457Z 0 
[Warning] InnoDB: Creating foreign key 
constraint system tables.2016-06-30T08:32:53.042621Z 0 [Warning] No existing UUID has been found, 
so we assume that this is the first time that this server has been started.
   Generating a new UUID: 3cb1686d-3e9d-11e6-a71f-fcaa14e34b30.2016-06-30T08:32:53.081210Z 0 [Warning] Gtid table is not ready to be used. 
Table 'mysql.gtid_executed' cannot be opened.2016-06-30T08:32:53.082538Z 1 [Note] A temporary password is generated for root@localhost: :8
#l!MCYoCNY### Author : Leshami### Blog   : http://www.php.cn/# mysqld_safe --defaults-file=/etc/my3317.cnf &[1] 58252016-06-30T08:11:49.468176Z 

mysqld_safe Logging to '/u02/mysqldata3317/ydq4.err'.2016-06-30T08:11:49.480379Z mysqld_safe The file /usr/local/mysql/bin/mysqld
does not exist or is not executable. Please cd to the mysql installation
directory and restart this script from there as follows:
./bin/mysqld_safe&
See http://dev.mysql.com/doc/mysql/en/mysqld-safe.html for more information###如果执行mysqld_safe出现上述错误,可以创建软链。这个地方有问题,
对于安装在非缺省目录时出现了这个问题。# mkdir -pv /usr/local/mysql/bin/# ln -sv /u01/app/mysql/bin/mysqld /usr/local/mysql/bin/mysqld      
"/usr/local/mysql/bin/mysqld" -> "/u01/app/mysql/bin/mysqld"# ./mysqld_safe --defaults-file=/etc/my3317.cnf &[1] 82872016-06-30T08:38:38.455961Z 
mysqld_safe Logging to '/u02/mysqldata3317/ydq4.err'.2016-06-30T08:38:38.471542Z mysqld_safe Starting mysqld daemon with databases from /u02/mysqldata3317
###配置安全选项# /u01/app/mysql/bin/mysql_secure_installation -P3317 -S /tmp/mysql3317.sock -p

5. Weitere MySQL-Installations- und Deinstallationsreferenzen

Installieren Sie MySQL 5.6 unter Linux 5 (RPM-Modus)
Deinstallieren Sie MySQL 5 unter Linux
Installation von MySQL 5.6 basierend auf dem Quellcode unter Linux
Vollversion der MySQL-Quellcode-Installation unter Linux
Einige Hinweise zur Installation des MySQL-Quellcodes scr.rpm

Das Obige ist der Inhalt. Weitere verwandte Inhalte finden Sie auf der chinesischen PHP-Website (www.php.cn)!

Stellungnahme
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn
Wie ist die Lizenzierung von MySQL mit anderen Datenbanksystemen verglichen?Wie ist die Lizenzierung von MySQL mit anderen Datenbanksystemen verglichen?Apr 25, 2025 am 12:26 AM

MySQL verwendet eine GPL -Lizenz. 1) Die GPL -Lizenz ermöglicht die freie Verwendung, Änderung und Verteilung von MySQL, aber die geänderte Verteilung muss GPL entsprechen. 2) Gewerbelizenzen können öffentliche Änderungen vermeiden und für gewerbliche Anwendungen geeignet sind, die Vertraulichkeit erfordern.

Wann würden Sie InnoDB über MyISAM wählen und umgekehrt?Wann würden Sie InnoDB über MyISAM wählen und umgekehrt?Apr 25, 2025 am 12:22 AM

Die Situationen bei der Auswahl von InnoDB anstelle von MyISAM umfassen: 1) Unterstützung der Transaktion, 2) hohe Genauigkeitsumgebung, 3) hohe Datenkonsistenz; Umgekehrt umfasst die Situation bei der Auswahl von MyISAM: 1) hauptsächlich Lesen von Operationen, 2) Es ist keine Transaktionsunterstützung erforderlich. InnoDB ist für Anwendungen geeignet, die eine hohe Datenkonsistenz und Transaktionsverarbeitung erfordern, z. B. E-Commerce-Plattformen, während MyISAM für lessintensive und transaktionsfreie Anwendungen wie Blog-Systeme geeignet ist.

Erklären Sie den Zweck von Fremdschlüssel in MySQL.Erklären Sie den Zweck von Fremdschlüssel in MySQL.Apr 25, 2025 am 12:17 AM

In MySQL besteht die Funktion von Fremdschlüssel darin, die Beziehung zwischen Tabellen herzustellen und die Konsistenz und Integrität der Daten zu gewährleisten. Fremdeschlüssel behalten die Wirksamkeit von Daten durch Referenzintegritätsprüfungen und Kaskadierungsvorgänge bei. Achten Sie auf die Leistungsoptimierung und vermeiden Sie bei der Verwendung häufige Fehler.

Was sind die verschiedenen Arten von Indizes in MySQL?Was sind die verschiedenen Arten von Indizes in MySQL?Apr 25, 2025 am 12:12 AM

Es gibt vier Hauptindextypen in MySQL: B-Tree-Index, Hash-Index, Volltextindex und räumlicher Index. 1.B-Tree-Index ist für Reichweite, Sortierung und Gruppierung geeignet und für die Erstellung der Namensspalte der Mitarbeiter-Tabelle geeignet. 2. Hash -Index ist für äquivalente Abfragen geeignet und für die Erstellung der ID -Spalte der Tabelle Hash_Table der Speicherspeicher -Engine geeignet. 3. Der Volltextindex wird für die Textsuche verwendet, die für die Erstellung in der Inhaltspalte der Artikeltabelle geeignet ist. 4. Der räumliche Index wird für die Geospatial -Abfrage verwendet, die für die Erstellung auf Geom -Spalten der Standorte Tabelle geeignet ist.

Wie erstellen Sie einen Index in MySQL?Wie erstellen Sie einen Index in MySQL?Apr 25, 2025 am 12:06 AM

TocreateanIndexinMysql, UsethecreatInedExStatement.1) ForasingLecolumn, verwenden Sie "createIdexidx_lastNameOntrayees (Nachname); 2) foracompositeIndex, verwenden" createIndexidx_nameonomiebhaber (Lastname, Firstname);

Wie unterscheidet sich MySQL von SQLite?Wie unterscheidet sich MySQL von SQLite?Apr 24, 2025 am 12:12 AM

Der Hauptunterschied zwischen MySQL und SQLite ist das Design-Konzept und die Nutzungsszenarien: 1. MySQL eignet sich für große Anwendungen und Lösungen auf Unternehmensebene, die hohe Leistung und hohe Parallelität unterstützen. 2. SQLite ist für mobile Anwendungen und Desktop -Software geeignet, leicht und leicht einzubetten.

Was sind Indizes in MySQL und wie verbessern sie die Leistung?Was sind Indizes in MySQL und wie verbessern sie die Leistung?Apr 24, 2025 am 12:09 AM

Indizes in MySQL sind eine geordnete Struktur einer oder mehrerer Spalten in einer Datenbanktabelle, die zur Beschleunigung der Datenabnahme verwendet wird. 1) Indexe verbessern die Abfragegeschwindigkeit durch Reduzierung der Menge an gescannten Daten. 2) B-Tree-Index verwendet eine ausgewogene Baumstruktur, die für die Reichweite und Sortierung geeignet ist. 3) Verwenden Sie CreateIndex -Anweisungen, um Indizes zu erstellen, z. 4) Zusammengesetzte Indizes können Multi-Säulen-Abfragen optimieren, z. 5) Erklärung verwenden, um Abfragepläne zu analysieren und zu vermeiden

Erklären Sie, wie Transaktionen in MySQL verwendet werden, um die Datenkonsistenz zu gewährleisten.Erklären Sie, wie Transaktionen in MySQL verwendet werden, um die Datenkonsistenz zu gewährleisten.Apr 24, 2025 am 12:09 AM

Durch die Verwendung von Transaktionen in MySQL wird die Datenkonsistenz gewährleistet. 1) Starten Sie die Transaktion über starttransaction und führen Sie dann SQL -Operationen aus und senden Sie sie mit Commit oder Rollback. 2) Setzen Sie SavePoint, um einen Speicherpunkt zu setzen, um teilweise Rollback zu ermöglichen. 3) Vorschläge zur Leistungsoptimierung umfassen die Verkürzung der Transaktionszeit, die Vermeidung großer Abfragen und die Verwendung von Isolationsniveaus.

See all articles

Heiße KI -Werkzeuge

Undresser.AI Undress

Undresser.AI Undress

KI-gestützte App zum Erstellen realistischer Aktfotos

AI Clothes Remover

AI Clothes Remover

Online-KI-Tool zum Entfernen von Kleidung aus Fotos.

Undress AI Tool

Undress AI Tool

Ausziehbilder kostenlos

Clothoff.io

Clothoff.io

KI-Kleiderentferner

Video Face Swap

Video Face Swap

Tauschen Sie Gesichter in jedem Video mühelos mit unserem völlig kostenlosen KI-Gesichtstausch-Tool aus!

Heiße Werkzeuge

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Leistungsstarke integrierte PHP-Entwicklungsumgebung

SublimeText3 Englische Version

SublimeText3 Englische Version

Empfohlen: Win-Version, unterstützt Code-Eingabeaufforderungen!

Notepad++7.3.1

Notepad++7.3.1

Einfach zu bedienender und kostenloser Code-Editor

SAP NetWeaver Server-Adapter für Eclipse

SAP NetWeaver Server-Adapter für Eclipse

Integrieren Sie Eclipse mit dem SAP NetWeaver-Anwendungsserver.

WebStorm-Mac-Version

WebStorm-Mac-Version

Nützliche JavaScript-Entwicklungstools