MySQL5.6默认存储引擎是myisam,而不是innodb

lrl1mhuk  于 2021-06-23  发布在  Mysql
关注(0)|答案(2)|浏览(475)

我是新来的,希望有人能帮我解决mysql问题。
在这里,我遇到了一个奇怪的情况,innodb不是默认的存储引擎:
mysql版本14.14发行版5.6.39,用于linux(x86\u 64),使用editline Package 器。
linux发行版:centos linux 7.5.1804版(核心版)
我尝试了几乎每一个解决方案,使innodb成为默认引擎,但它确实为我工作。
以下是我尝试过的几件事:
第一步

files my.cnf and my.ini. has been edited in /root/my.cnf and /root/my.ini and /etc/my.cnf as:

[mysqld]
character-set-server=utf8
collation-server=utf8_bin
default-storage-engine=INNODB
max_allowed_packet=256M
innodb_log_file_size=2GB
transaction-isolation=READ-COMMITTED
binlog_format=row

步骤2保存文件后,我确实用几种方法重新启动了mysql:

Following commands DID NOT work:

# /etc/init.d/mysqld stop:  No such file or directory

# /etc/init.d/mysql stop:  No such file or directory

# service mysqld stop

Redirecting to /bin/systemctl start mysql.service
Failed to start mysqld.service: Unit not found.

Following commands DID work:

# service mysql stop

Redirecting to /bin/systemctl start mysql.service

# service mysql status (was Active: inactive (dead))

# service mysql start

Redirecting to /bin/systemctl start mysql.service

# service mysql status (was Active: active (running))

第3步

mysql> SHOW ENGINES;
    +--------------------+---------+----------------------------------------------------------------+--------------+------+------------+
    | Engine             | Support | Comment                                                        
    | Transactions | XA   | Savepoints |
    +--------------------+---------+----------------------------------------------------------------+--------------+------+------------+
    | FEDERATED          | NO      | Federated MySQL storage engine                                 
    | NULL         | NULL | NULL       |
    | MRG_MYISAM         | YES     | Collection of identical MyISAM tables                          
    | NO           | NO   | NO         |
    | MyISAM             | DEFAULT | MyISAM storage engine                                          
    | NO           | NO   | NO         |
    | BLACKHOLE          | YES     | /dev/null storage engine (anything you write to it disappears) | NO           | NO   | NO         |
    | CSV                | YES     | CSV storage engine                                             
    | NO           | NO   | NO         |
    | MEMORY             | YES     | Hash based, stored in memory, useful for temporary tables      | NO           | NO   | NO         |
    | ARCHIVE            | YES     | Archive storage engine                                         
    | NO           | NO   | NO         |
    | InnoDB             | YES     | Supports transactions, row-level locking, and foreign keys     | YES          | YES  | YES        |
    | PERFORMANCE_SCHEMA | YES     | Performance Schema                                             
    | NO           | NO   | NO         |
    +--------------------+---------+----------------------------------------------------------------+--------------+------+------------+
    9 rows in set (0.00 sec)

    mysql>

第四步我尝试了下面的命令,最后我得到了innodb作为默认值,但仍然没有工作,因为一旦你重置mysqld它会回到myisam是默认值

SET default_storage_engine=INNODB;

这真是令人沮丧,你的帮助将不胜感激

ppcbkaq5

ppcbkaq51#

我终于解决了这个问题。我做了“卸载和重新安装完全相同的MySQL5.6.39版本的mysql”之后,一切都很好。我的innodb已更改为默认的storage engine=innodb。

7ajki6be

7ajki6be2#

可以通过以下步骤实现:导航到>phpmyadmin>home>variables>storage engine,并将其myisam更改为innodb
看到图片了吗

相关问题