TLS phpmyadmin 访问被拒绝且 mysql 数据库未运行

TLS phpmyadmin 访问被拒绝且 mysql 数据库未运行

我在 Ubuntu 16.04.1 上安装了 XAMPP这些说明. 问题是:

  1. 无法访问localhost/phpmyadmin

    请点击此图像。

  2. MySQL 数据库无法运行。

  3. 当我打开配置>打开日志来自 MySQL 数据库 XAMPP GUI。结果如下。

    2016-10-16 09:54:30 8005 mysqld_safe Starting mysqld daemon with databases from /opt/lampp/var/mysql 
    2016-10-16  9:54:31 139780487444288 [Note] Using unique option prefix 'key_buffer' is error-prone and can break in the future. Please use the full name 'key_buffer_size' instead. 
    2016-10-16  9:54:31 139780487444288 [Note] /opt/lampp/sbin/mysqld (mysqld 10.1.16-MariaDB) starting as process 8152 ... 
    2016-10-16  9:54:31 139780487444288 [Note] InnoDB: innodb_empty_free_list_algorithm has been changed to legacy because of small buffer pool size. In order to use backoff, increase buffer pool at least up to 20MB.
    2016-10-16  9:54:31 139780487444288 [Note] InnoDB: Using mutexes to ref count buffer pool pages 
    2016-10-16  9:54:31 139780487444288 [Note] InnoDB: The InnoDB memory heap is disabled 
    2016-10-16  9:54:31 139780487444288 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins 
    2016-10-16  9:54:31 139780487444288 [Note] InnoDB: Memory barrier is not used 
    2016-10-16  9:54:31 139780487444288 [Note] InnoDB: Compressed tables use zlib 1.2.8 
    2016-10-16  9:54:31 139780487444288 [Note] InnoDB: Using generic crc32 instructions 
    2016-10-16  9:54:31 139780487444288 [Note] InnoDB: Initializing buffer pool, size = 16.0M 
    2016-10-16  9:54:31 139780487444288 [Note] InnoDB: Completed initialization of buffer pool 
    2016-10-16  9:54:31 139780487444288 [Note] InnoDB: Highest supported file format is Barracuda. 
    2016-10-16  9:54:32 139780487444288 [Note] InnoDB: 128 rollback segment(s) are active. 
    2016-10-16  9:54:32 139780487444288 [Note] InnoDB: Waiting for purge to start 
    2016-10-16  9:54:32 139780487444288 [Note] InnoDB:  Percona XtraDB (http://www.percona.com) 5.6.30-76.3 started; log sequence number 1762733 
    2016-10-16  9:54:32 139780096513792 [Note] InnoDB: Dumping buffer pool(s) not yet started 
    2016-10-16  9:54:32 139780487444288 [Note] Plugin 'FEEDBACK' is disabled. 
    2016-10-16  9:54:32 139780487444288 [Note] Server socket created on IP: '::'. 
    2016-10-16  9:54:32 139780487444288 [ERROR] Can't start server: Bind on TCP/IP port. Got error: 98: Address already in use 
    2016-10-16  9:54:32 139780487444288 [ERROR] Do you already have another mysqld server running on port: 3306 ? 
    2016-10-16  9:54:32 139780487444288 [ERROR] Aborting
    2016-10-16 09:54:34 8005 mysqld_safe mysqld from pid file /opt/lampp/var/mysql/laptop.pid ended 
    2016-10-16 10:04:30 9155 mysqld_safe Starting mysqld daemon with databases from /opt/lampp/var/mysql 
    2016-10-16 10:04:30 140396037838656 [Note] Using unique option prefix 'key_buffer' is error-prone and can break in the future. Please use the full name 'key_buffer_size' instead. 
    2016-10-16 10:04:30 140396037838656 [Note] /opt/lampp/sbin/mysqld (mysqld 10.1.16-MariaDB) starting as process 9299 ... 
    2016-10-16 10:04:30 140396037838656 [Note] InnoDB: innodb_empty_free_list_algorithm has been changed to legacy because of small buffer pool size. In order to use backoff, increase buffer pool at least up to 20MB.
    2016-10-16 10:04:30 140396037838656 [Note] InnoDB: Using mutexes to ref count buffer pool pages 
    2016-10-16 10:04:30 140396037838656 [Note] InnoDB: The InnoDB memory heap is disabled 
    2016-10-16 10:04:30 140396037838656 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins 
    2016-10-16 10:04:30 140396037838656 [Note] InnoDB: Memory barrier is not used 
    2016-10-16 10:04:30 140396037838656 [Note] InnoDB: Compressed tables use zlib 1.2.8 
    2016-10-16 10:04:30 140396037838656 [Note] InnoDB: Using generic crc32 instructions 
    2016-10-16 10:04:30 140396037838656 [Note] InnoDB: Initializing buffer pool, size = 16.0M 
    2016-10-16 10:04:30 140396037838656 [Note] InnoDB: Completed initialization of buffer pool 
    2016-10-16 10:04:30 140396037838656 [Note] InnoDB: Highest supported file format is Barracuda. 
    2016-10-16 10:04:30 140396037838656 [Note] InnoDB: 128 rollback segment(s) are active. 
    2016-10-16 10:04:30 140396037838656 [Note] InnoDB: Waiting for purge to start 
    2016-10-16 10:04:30 140396037838656 [Note] InnoDB:  Percona XtraDB (http://www dot percona dot com) 5.6.30-76.3 started; log sequence number 1762743 
    2016-10-16 10:04:30 140395652552448 [Note] InnoDB: Dumping buffer pool(s) not yet started 
    2016-10-16 10:04:30 140396037838656 [Note] Plugin 'FEEDBACK' is disabled. 
    2016-10-16 10:04:30 140396037838656 [Note] Server socket created on IP: '::'. 
    2016-10-16 10:04:30 140396037838656 [ERROR] Can't start server: Bind on TCP/IP port. Got error: 98: Address already in use 
    2016-10-16 10:04:30 140396037838656 [ERROR] Do you already have another mysqld server running on port: 3306 ? 
    2016-10-16 10:04:30 140396037838656 [ERROR] Aborting
    2016-10-16 10:04:32 9155 mysqld_safe mysqld from pid file /opt/lampp/var/mysql/laptop.pid ended
    

有人能帮助我吗?

更新

虽然在 XAMPP GUI 中 mysql 不起作用,但是当我在终端中运行它时它可以工作。所以我不知道我应该相信哪一个。

$ sudo /opt/lampp/xampp start
Starting XAMPP for Linux 7.0.9-1...
XAMPP: Starting Apache...already running. 
XAMPP: Starting MySQL...ok.
XAMPP: Starting ProFTPD...ok.

重新安装XAMPP:

MySQL 数据库正在运行,Apache Web 服务器已停止。

Starting XAMPP for Linux 7.0.9-1...    
XAMPP: Starting Apache...fail.    
XAMPP:  Another web server is already running.    
XAMPP: Starting MySQL...already running.    
XAMPP: Starting ProFTPD...fail.    
XAMPP:  Another FTP daemon is already running.

答案1

我使用 Linux mint 19 时遇到过这个问题,我用 Google 搜索了一下,但始终不明白这个问题的原因,即使我知道了解决方案。

过了一段时间,我注意到有这样一种东西单元 mysql.service与我自己的 MySQL 数据库冲突。

如何解决?

我注意到您正在运行 Ubuntu,因此 XAMPP、MySQL……的安装目录应该与下面所述的相同:

  • 正确安装 XAMPP。
  • 打开终端并输入命令sudo /opt/lampp/lampp start来运行 XAMPP 服务。
  • 打开一个新的终端窗口,然后输入此命令:sudo service mysql stop
  • 重新启动 XAMPP 服务:sudo /opt/lampp/lampp restart

现在您可以通过浏览器访问 phpMyAdmin,并通过终端访问数据库监视器。

请注意:此解决方案不能永久解决问题!它仅允许您在登录会话时在数据库中工作,重新启动后,您必须执行上述相同的步骤。

答案2

步骤1:打开文件/opt/lampp/etc/my.cnf
步骤2:添加代码innodb_force_recovery = 1
步骤3:重新启动或启动MySql。

相关内容