php选择mysql数据库失败_php选择数据库失败

是啊。

你可以看下的php.ini配置文件中的:

[MySQL]

; Allow or prevent persistent links.

mysql.allow_persistent = On

; Maximum number of persistent links. -1 means no limit.

mysql.max_persistent = -1

; Maximum number of links (persistent + non-persistent). -1 means no limit.

mysql.max_links = -1

; Default port number for mysql_connect(). If unset, mysql_connect() will use

; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the

; compile-time value defined MYSQL_PORT (in that order). Win32 will only look

; at MYSQL_PORT.

mysql.default_port =3306

; Default socket name for local MySQL connects. If empty, uses the built-in

; MySQL defaults.

mysql.default_socket =

; Default host for mysql_connect() (doesn't apply in safe mode).

mysql.default_host =localhost

; Default user for mysql_connect() (doesn't apply in safe mode).

mysql.default_user =root

; Default password for mysql_connect() (doesn't apply in safe mode).

; Note that this is generally a *bad* idea to store passwords in this file.

; *Any* user with PHP access can run 'echo get_cfg_var("mysql.default_password")

; and reveal this password! And of course, any users with read access to this

; file will be able to reveal the password as well.

mysql.default_password =123456

上面你指定的用户(如我指定的:root [mysql.default_user =root])中是否存在该数据库。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值