gpt4 book ai didi

XAMPP 中的 MySQL 数据库已停止

转载 作者:行者123 更新时间:2023-11-29 11:45:55 25 4
gpt4 key购买 nike

我在 Linux(Ubuntu 14.04)上运行 Xampp,虽然一切都工作正常,直到我关闭它后一小时,它突然开始抛出此错误。错误:

MySQL said: Documentation Cannot connect: invalid settings. Connection for controluser as defined in your configuration failed. phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.

错误信息图片: Error Message

我的config.inc.php:

<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
* phpMyAdmin sample configuration, you can use it as base for
* manual configuration. For easier setup you can use setup/
*
* All directives are explained in documentation in the doc/ folder
* or at <http://docs.phpmyadmin.net/>.
*
* @package PhpMyAdmin
*/

/*
* This is needed for cookie based authentication to encrypt password in
* cookie
*/
$cfg['blowfish_secret'] = 'xampp'; /* YOU SHOULD CHANGE THIS FOR A MORE SECURE COOKIE AUTH! */

/*
* Servers configuration
*/
$i = 0;

/*
* First server
*/
$i++;
/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'brahim';
$cfg['Servers'][$i]['password'] = '';
/* Server parameters */
//$cfg['Servers'][$i]['host'] = 'localhost';
//$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = true;
$cfg['Servers'][$i]['AllowNoPassword'] = true;

/*
* phpMyAdmin configuration storage settings.
*/

/* User used to manipulate with storage */
// $cfg['Servers'][$i]['controlhost'] = '';
// $cfg['Servers'][$i]['controlport'] = '';
$cfg['Servers'][$i]['controluser'] = 'pma';
$cfg['Servers'][$i]['controlpass'] = '';

/* Storage database and tables */
$cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
$cfg['Servers'][$i]['bookmarktable'] = 'pma__bookmark';
$cfg['Servers'][$i]['relation'] = 'pma__relation';
$cfg['Servers'][$i]['table_info'] = 'pma__table_info';
$cfg['Servers'][$i]['table_coords'] = 'pma__table_coords';
$cfg['Servers'][$i]['pdf_pages'] = 'pma__pdf_pages';
$cfg['Servers'][$i]['column_info'] = 'pma__column_info';
$cfg['Servers'][$i]['history'] = 'pma__history';
$cfg['Servers'][$i]['table_uiprefs'] = 'pma__table_uiprefs';
$cfg['Servers'][$i]['tracking'] = 'pma__tracking';
$cfg['Servers'][$i]['userconfig'] = 'pma__userconfig';
$cfg['Servers'][$i]['recent'] = 'pma__recent';
// $cfg['Servers'][$i]['favorite'] = 'pma__favorite';
// $cfg['Servers'][$i]['users'] = 'pma__users';
// $cfg['Servers'][$i]['usergroups'] = 'pma__usergroups';
// $cfg['Servers'][$i]['navigationhiding'] = 'pma__navigationhiding';
// $cfg['Servers'][$i]['savedsearches'] = 'pma__savedsearches';
// $cfg['Servers'][$i]['central_columns'] = 'pma__central_columns';
/* Contrib / Swekey authentication */
// $cfg['Servers'][$i]['auth_swekey_config'] = '/etc/swekey-pma.conf';

/*
* End of servers configuration
*/

/*
* Directories for saving/loading files from server
*/
$cfg['UploadDir'] = '';
$cfg['SaveDir'] = '';

/**
* Whether to display icons or text or both icons and text in table row
* action segment. Value can be either of 'icons', 'text' or 'both'.
*/
//$cfg['RowActionType'] = 'both';

/**
* Defines whether a user should be displayed a "show all (records)"
* button in browse mode or not.
* default = false
*/
//$cfg['ShowAll'] = true;

/**
* Number of rows displayed when browsing a result set. If the result
* set contains more rows, "Previous" and "Next".
* default = 30
*/
//$cfg['MaxRows'] = 50;

/**
* disallow editing of binary fields
* valid values are:
* false allow editing
* 'blob' allow editing except for BLOB fields
* 'noblob' disallow editing except for BLOB fields
* 'all' disallow editing
* default = blob
*/
//$cfg['ProtectBinary'] = 'false';

/**
* Default language to use, if not browser-defined or user-defined
* (you find all languages in the locale folder)
* uncomment the desired line:
* default = 'en'
*/
//$cfg['DefaultLang'] = 'en';
//$cfg['DefaultLang'] = 'de';

/**
* How many columns should be used for table display of a database?
* (a value larger than 1 results in some information being hidden)
* default = 1
*/
//$cfg['PropertiesNumColumns'] = 2;

/**
* Set to true if you want DB-based query history.If false, this utilizes
* JS-routines to display query history (lost by window close)
*
* This requires configuration storage enabled, see above.
* default = false
*/
//$cfg['QueryHistoryDB'] = true;

/**
* When using DB-based query history, how many entries should be kept?
*
* default = 25
*/
//$cfg['QueryHistoryMax'] = 100;

/**
* Should error reporting be enabled for JavaScript errors
*
* default = 'ask'
*/
//$cfg['SendErrorReports'] = 'ask';

/*
* You can find more configuration options in the documentation
* in the doc/ folder or at <http://docs.phpmyadmin.net/>.
*/

当将cfg['Servers'][$i]['auth_type']更改为'cookie'时,他遇到了另一个问题:

Cannot log in to the MySQL server Connection for controluser as defined in your configuration failed.

日志错误:

2016-01-23 06:37:42 8648 mysqld_safe mysqld from pid file /opt/lampp/var/mysql/DrBrm.pid ended
2016-01-23 20:31:06 2900 mysqld_safe Starting mysqld daemon with databases from /opt/lampp/var/mysql
2016-01-23 20:31:07 0 [Warning] Using unique option prefix key_buffer instead of key_buffer_size is deprecated and will be removed in a future release. Please use the full name instead.
2016-01-23 20:31:07 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-01-23 20:31:07 0 [Note] /opt/lampp/sbin/mysqld (mysqld 5.6.26) starting as process 3247 ...
2016-01-23 20:31:07 3247 [Note] Plugin 'FEDERATED' is disabled.
2016-01-23 20:31:07 3247 [Note] InnoDB: Using atomics to ref count buffer pool pages
2016-01-23 20:31:07 3247 [Note] InnoDB: The InnoDB memory heap is disabled
2016-01-23 20:31:07 3247 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-01-23 20:31:07 3247 [Note] InnoDB: Memory barrier is not used
2016-01-23 20:31:07 3247 [Note] InnoDB: Compressed tables use zlib 1.2.8
2016-01-23 20:31:07 3247 [Note] InnoDB: Using CPU crc32 instructions
2016-01-23 20:31:07 3247 [Note] InnoDB: Initializing buffer pool, size = 16.0M
2016-01-23 20:31:07 3247 [Note] InnoDB: Completed initialization of buffer pool
2016-01-23 20:31:07 3247 [Note] InnoDB: Highest supported file format is Barracuda.
2016-01-23 20:31:07 3247 [Note] InnoDB: The log sequence numbers 1624742 and 1624742 in ibdata files do not match the log sequence number 1682069 in the ib_logfiles!
2016-01-23 20:31:07 3247 [Note] InnoDB: Database was not shutdown normally!
2016-01-23 20:31:07 3247 [Note] InnoDB: Starting crash recovery.
2016-01-23 20:31:07 3247 [Note] InnoDB: Reading tablespace information from the .ibd files...
2016-01-23 20:31:07 3247 [ERROR] InnoDB: Attempted to open a previously opened tablespace. Previous tablespace myshop/client_compte uses space ID: 10 at filepath: ./myshop/client_compte.ibd. Cannot open tablespace myshop/mobile12 which uses space ID: 10 at filepath: ./myshop/mobile12.ibd
2016-01-23 20:31:07 7f8b98c6e740 InnoDB: Operating system error number 2 in a file operation.
InnoDB: The error means the system cannot find the path specified.
InnoDB: If you are installing InnoDB, remember that you must create
InnoDB: directories yourself, InnoDB does not create them.
InnoDB: Error: could not open single-table tablespace file ./myshop/mobile12.ibd
InnoDB: We do not continue the crash recovery, because the table may become
InnoDB: corrupt if we cannot apply the log records in the InnoDB log to it.
InnoDB: To fix the problem and start mysqld:
InnoDB: 1) If there is a permission problem in the file and mysqld cannot
InnoDB: open the file, you should modify the permissions.
InnoDB: 2) If the table is not needed, or you can restore it from a backup,
InnoDB: then you can remove the .ibd file, and InnoDB will do a normal
InnoDB: crash recovery and ignore that table.
InnoDB: 3) If the file system or the disk is broken, and you cannot remove
InnoDB: the .ibd file, you can set innodb_force_recovery > 0 in my.cnf
InnoDB: and force InnoDB to continue crash recovery here.
2016-01-23 20:31:07 2900 mysqld_safe mysqld from pid file /opt/lampp/var/mysql/DrBrm.pid ended

最佳答案

不幸的是,这看起来不像是好消息。

根据您发布的错误日志,myshop 数据库中的 mobile12 表似乎已损坏,这就是 MySQL 无法启动的原因。建议采用三种解决方案:

1) If there is a permission problem in the file and mysqld cannot open the file, you should modify the permissions.

检查 MySQL 数据目录(可能是 /opt/lampp/var/mysql)中文件 ./myshop/mobile12.ibd 的权限。将您找到的内容与数据目录中其他子目录中的其他文件进行比较。

2) If the table is not needed, or you can restore it from a backup, then you can remove the .ibd file, and InnoDB will do a normal crash recovery and ignore that table.

删除 ./myshop/mobile12.ibd 文件。请注意,删除它会从数据库中销毁它,因此您需要从备份中恢复。假设您有最近的备份,这很可能是最佳解决方案。

3) If the file system or the disk is broken, and you cannot remove the .ibd file, you can set innodb_force_recovery > 0 in my.cnf and force InnoDB to continue crash recovery here.

我不太清楚评论在这里建议什么,如果这意味着设置innodb_force_recovery将尝试从损坏的文件中拯救数据,或者它是否会解决该文件并尝试将其删除自动地。

删除损坏的 .idb 文件后,守护程序应该会再次正常启动。很抱歉这个坏消息,但这应该会让你再次前进。

关于XAMPP 中的 MySQL 数据库已停止,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34953726/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com