【问题标题】:MariaDB + phpmyadmin with Ngnix on ubuntu 14.04MariaDB + phpmyadmin 在 ubuntu 14.04 上使用 Nginx
【发布时间】:2016-09-29 20:32:54
【问题描述】:

我正在尝试安装 phpmyadmin + mariadb。

我的 PHP 配置字符串具有以下 mysql 标志

CONFIGURE_STRING="--prefix=/etc/php7 --enable-mysqlnd --with-mysqli=mysqlnd  
--with-pdo-mysql=mysqlnd <and other flags>"

我安装了 mariadb,如下:

sudo apt-get install mariadb-client mariadb-server  
sudo mysql_secure_installation  

我可以通过密码登录

sudo mysql -u root -p

然后我用

安装了 phpmyadmin
cd /var/www/html
git clone --depth=1 --branch=STABLE https://github.com/phpmyadmin/phpmyadmin.git
mv phpmyadmin datastore    #change name to datastore

当我打开http://localhost/datastore 时,我收到了 phpmyadmin 登录页面;在尝试使用 root 用户名和 root 密码登录时,我收到以下错误:

#2002 - No such file or directory — The server is not responding (or the local server's socket is not correctly configured).

                                           AND


mysqli_real_connect(): (HY000/2002): No such file or directory.

我在 ubuntu 14.04 上使用 php7。

我希望能够连接 mariadb 和 phpmyadmin。

【问题讨论】:

    标签: nginx phpmyadmin mariadb


    【解决方案1】:

    从 Git 获得了一些关于如何解决问题的指示,这些是我的步骤,我觉得有人可能会遇到同样的挑战。

    在 phpmyadmin 中将 config.sample.inc.php 复制到 config.inc.php

    sudo cp config.sample.inc.php config.inc.php
    

    使用 STATUS 检查 MariaDB 状态;

    MariaDB [(none)]>STATUS; [ENTER]
    

    检查连接 - 如果 localhost 通过 Unix 套接字,则复制 unix 套接字值。

    转到 config.inc.php 并强制执行以下操作

    $cfg['Servers'][$i]['connect_type'] = 'socket';
    $cfg['Servers'][$i]['socket'] = '/var/run/mysqld/mysqld.sock';
    

    然后在phpmyadmin中更改config.inc.php的权限

    sudo chmod 0755 config.inc.php 
    

    将您的浏览器指向 phpmyadmin 并使用您的用户名和密码登录。

    Git link

    【讨论】:

      猜你喜欢
      • 2017-01-29
      • 2014-12-12
      • 2014-12-11
      • 1970-01-01
      • 1970-01-01
      • 2016-02-06
      • 1970-01-01
      • 1970-01-01
      • 2018-04-06
      相关资源
      最近更新 更多