phpMyAdmin 登录报错:mysqli_real_connect(): (HY000/2002): No such file or directory
技术积累 phpadmin

linux 安装完phpadmin后登陆报错:mysqli_real_connect(): (HY000/2002): No such file or directory

phpMyAdmin 登录报错:mysqli_real_connect(): (HY000/2002): No such file or directory

解决办法:

1,#查看mysql.sock文件地址
[root@localhost ~]# mysql -uroot -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 87198
Server version: 5.7.18-log MySQL Community Server (GPL)

Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> status;
--------------
mysql  Ver 14.14 Distrib 5.7.18, for linux-glibc2.5 (x86_64) using  EditLine wrapper

Connection id:        87198
Current database:    
Current user:        root@localhost
SSL:            Not in use
Current pager:        stdout
Using outfile:        ''
Using delimiter:    ;
Server version:        5.7.18-log MySQL Community Server (GPL)
Protocol version:    10
Connection:        Localhost via UNIX socket
Server characterset:    utf8mb4
Db     characterset:    utf8mb4
Client characterset:    utf8mb4
Conn.  characterset:    utf8mb4
UNIX socket:        /data/mysql/mysql.sock
Uptime:            18 days 4 hours 6 min 32 sec

Threads: 11  Questions: 124046  Slow queries: 16  Opens: 7543  Flush tables: 1  Open tables: 447  Queries per second avg: 0.079
--------------



2,#修改php.ini文件,参数填入mysql.scok的文件地址
[Pdo_mysql]
······
pdo_mysql.default_socket=/data/mysql/mysql.sock

[MySQLi]
······
mysqli.default_socket = /data/mysql/mysql.sock

重启php-fpm,重新登录

phpMyAdmin 登录报错:mysqli_real_connect(): (HY000/2002): No such file or directory

解决两个警告提示:

警告1:phpMyAdmin 高级功能尚未完全设置,部分功能未激活。查找原因。 或者也可以去某个数据库的“操作”选项卡那里进行设置。

#在phpmyadmin的程序目录下面找到sql目录,执行下create_tables.sql
cd phpadmin/sql
mysql -uroot -p -e 'source create_tables.sql'

警告2:配置文件现在需要一个短语密码

#修改程序根目录下config.sample.inc.php文件 和  libraries目录下config.default.php文件
vim config.sample.inc.php
······· 
$cfg['blowfish_secret'] = '1111-1111-1111-1111-1111-1111-1111'; //修改超过32个以上的字符即可

vim libraries/config.default.php
$cfg['blowfish_secret'] = '1111-1111-1111-1111-1111-1111-1111';

本文最后记录时间 2024-04-03
文章链接地址:
https://me.jinchuang.org/archives/293.html
本站文章除注明[转载|引用|来源],均为本站原创内容,转载前请注明出处

configure: error: C++ compiler g++ does not work or no compiler found

VMware ESXI /vCenter 6.5/6.7

留言列表

  1. 史寒
    Windows 10 Google Chrome
    中国上海市联通

    登录phpmyadmin时,出现这种情况如何解决?
    mysqli_real_connect(): (HY000/2002): ������ӷ���һ��ʱ���û���ȷ�?�ӵ����û�з�Ӧ�����ӳ���ʧ�ܡ�

    1. Awking
      Windows 10 Google Chrome
      中国天津市电信IDC机房

      你这乱码也不知道报的什么错误啊,先让报错信息正常显示出来就好解决了

      1. 小鸡
        Windows 7 QQ 浏览器
        中国广东省深圳市联通

        博主我也是登录不了显示一堆乱码:mysqli_real_connect(): (HY000/2002): ������ӷ���һ��ʱ���û���ȷ�?�ӵ����û�з�Ӧ�����ӳ���ʧ�ܡ�,要显示报错信息呢

        1. Awking
          Windows 10 Google Chrome
          中国上海市电信IDC机房

          看错误代码是一样的,你试试修改mysql.sock看看可以登录不

          1. 小鸡
            Windows 7 QQ 浏览器
            中国广东省深圳市联通

            解决了,端口改成3306就好了。

            1. Awking
              Windows 10 Google Chrome
              中国上海市联通IDC机房

              都是连接不上mysql的问题

留言已关闭

顶部