我刚刚使用MariaDB在Debian 9.1上遇到了这个问题,但这在Oracle MysqL中应该是相同的.我可以从命令行轻松登录,但PHP无法访问数据库.

我花了几分钟才弄明白,但我记得当时我曾经在旧服务器上使用Arch Linux(顺便说一句愚蠢的想法),需要命令MysqL_secure_installation才能让它接受连接.

尝试一下,这对我有用.

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB

SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it,we'll need the current

password for the root user. If you've just installed MariaDB,and

you haven't set the root password yet,the password will be blank,so you should just press enter here.

Enter current password for root (enter for none):

OK,successfully used password,moving on...

Setting the root password ensures that nobody can log into the MariaDB

root user without the proper authorisation.

Set root password? [Y/n] n

... skipping.

By default,a MariaDB installation has an anonymous user,allowing anyone

to log into MariaDB without having to have a user account created for

them. This is intended only for testing,and to make the installation

go a bit smoother. You should remove them before moving into a

production environment.

Remove anonymous users? [Y/n] y

... Success!

Normally,root should only be allowed to connect from 'localhost'. This

ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] y

... Success!

By default,MariaDB comes with a database named 'test' that anyone can

access. This is also intended only for testing,and should be removed

before moving into a production environment.

Remove test database and access to it? [Y/n] y

- Dropping test database...

... Success!

- Removing privileges on test database...

... Success!

Reloading the privilege tables will ensure that all changes made so far

will take effect immediately.

Reload privilege tables now? [Y/n] y

... Success!

Cleaning up...

All done! If you've completed all of the above steps,your MariaDB

installation should now be secure.

Thanks for using MariaDB!

php cli mysql_php – 为什么mysql CLI可以连接,但不能连接WordPress?相关推荐

  1. mysql安装以及安装navicat并且连接

    mysql安装以及安装navicat并且连接 文章目录 mysql安装以及安装navicat并且连接 1. 数据结构模型 2. 专业名词 3. 常见的组件 4. SQL语句 5. MySQL的安装与配 ...

  2. vue/cli是什么?vue/cli如何使用? 入门篇(安装创建,组件使用,定义路由,项目导出) ∠( °ω°)/ 前端知识

    文章目录 简介 安装 安装nodejs nvm npm换源 单次换源 永久换源 方法一 方法二 Vue/cli安装 创建Vue/cli项目 解决常见错误 用命令行创建项目 可视化界面创建 项目目录简介 ...

  3. MySQL 学习笔记(15)— 连接查询(内连接、左外连接、右外连接、全外连接、交叉连接、自然连接等)

    本文参考:https://gitbook.cn/gitchat/column/undefined/topic/5db92b68a9c3a53bc3800eff SQL 支持的连接查询包括内连接.外连接 ...

  4. sql的四种连接 用mysql的语句写_170221、浅谈mysql的SQL的四种连接

    例子: ------------------------------------------------- a表     id   name     b表     id   job   parent_ ...

  5. mysql内连接和外连接的区别_Swoole4创建Mysql连接池

    一 .什么是mysql连接池 场景:每秒同时有1000个并发,但是这个mysql同时只能处理400个连接,mysql会宕机. 解决方案:连接池,这个连接池建立了200个和mysql的连接,这1000个 ...

  6. mysql join not in_MySQL 使用左连接替换not in

    众所周知,左连接和右连接的含义是以哪一张表为准. 左连接就是以左表为准,查出的结果中包含左表所有的记录,如果右表中没有与其对应的记录,那么那一行记录中B表部分的内容就全是NULL. 现在有两个表,一个 ...

  7. 【MySQL】(图解)快速理解内连接、外连接、左连接、右连接

    [1] 示例数据   用两个表(a_table.b_table),关联字段a_table.a_id和b_table.b_id来演示一下MySQL的内连接.外连接( 左(外)连接.右(外)连接).    ...

  8. mysql 多表既有内连接又有外连接_MySQL 多表查询中的内连接和外连接

    一般情况下一个网站的数据库通常会有多张数据表组成,这些数据表分别存储网站不同区域的内容.数据表之间可以用类似 ID 的字段来关联,在查询的时候可以通过一条语句来查询多张表的内容.例如 论坛的数据库,帖 ...

  9. my SQL下载安装,环境配置,以及密码忘记的解决,以及navicat for mysql下载,安装,测试连接...

    一.下载 在百度上搜索"mysql-5.6.24-winx64下载" 二.安装 选择安装路径,我的路径"C:\Soft\mysql-5.6.24-winx64" ...

最新文章

  1. jenkins+docker部署java项目
  2. 简单比较python语言和c语言的异同-Python快速入门之与C语言异同
  3. Android运行时识别API版本
  4. 信息安全之网络安全初体验(保密向)(一)
  5. 【学习笔记】18、函数的其他功能
  6. 一个中科院退学博士生的感想(zz)
  7. java 通过jdbc驱动连接hive操作实例
  8. 去重+排序板子(set+map)
  9. iOS推送(利用极光推送)
  10. Linux 下五个顶级的开源命令行 Shell
  11. 程序员在这些地方敲代码,普通笔记本根本扛不住
  12. (个人简历一)用纯html写个人简历
  13. 一个移动开发老码农的书单
  14. 职场新人如何招架同事倚老卖老?
  15. miui系统备份恢复失败(一招解决,,无需技术也行)
  16. 简易网络直播聊天室源码+自适应手机版正规企业财经直播聊天室系统
  17. 我自己动手写一个网页收藏站,你说行不行?【html+css+js】#谭子
  18. 如何将本地图片转成图片链接
  19. 你想不到,韩国女团最喜欢的英文单词是这些
  20. 【SSLGZ 1344】Knights

热门文章

  1. 幼儿课外活动游戏_幼儿园的户外活动游戏有哪些?
  2. python 生成pdf收据_python如何与以太坊交互并将区块链信息写入SQLite
  3. python中format的用法菜鸟教程-初学者必知的Python中优雅的用法
  4. Bootloader详解
  5. Cpp 对象模型探索 / 类静态成员函数的调用方式
  6. gcc / -E、-S、-c 和 -o
  7. linux qt5.9 下载,在Ubuntu17.04上安装QT5.9.0(下载、安装、问题解决)
  8. js map 箭头_JS异常函数之-箭头函数
  9. jlist放jbutton 按钮事件失效_JS DOM操作 函数 事件 阻止事件冒泡
  10. java经典50道_50道经典的JAVA编程题(41-45)