靳闯博客 记录是一种习惯,分享是一种态度
  • 波浪
  • 波浪
  • 波浪
  • 波浪
phpMyAdmin 登录报错:mysqli_real_connect(): (HY000/2002): No such file or directory
发表于: | 分类: 技术积累 | 标签: phpadmin | 评论:0 | 阅读: 122

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

phpadmin1.png

解决办法:

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,重新登录

phpadmin2.png

解决两个警告提示:

警告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';

商业转载请联系作者获得授权,非商业转载请注明出处,谢谢合作。


如果这篇文章帮助到了你,我感到十分荣幸!

或许你不想写点什么·但我依旧在这里

icon_mrgreen.pngicon_neutral.pngicon_twisted.pngicon_arrow.pngicon_eek.pngicon_smile.pngicon_confused.pngicon_cool.pngicon_evil.pngicon_biggrin.pngicon_idea.pngicon_redface.pngicon_razz.pngicon_rolleyes.pngicon_wink.pngicon_cry.pngicon_surprised.pngicon_lol.pngicon_mad.pngicon_sad.pngicon_exclaim.pngicon_question.png2018new_aini_org.png2018new_baobao_thumb.png2018new_erha_org.png2018new_kuxiao_thumb.png2018new_yun_thumb.png2018new_hufen_thumb.png2018new_gui_org.png2018new_xiaoerbuyu_org.png2018new_heixian_thumb.png2018new_wabi_thumb.png2018new_tianping_thumb.png

站点地图 网站地图
豫ICP备17003270号 | Copyright © 2018 💖 靳闯博客
Typecho🍹Sgreen
TOP