代码执行错误
$mysqli=new mysqli("localhost","root","","test4");
var_dump($mysqli);
Warning: Unterminated comment starting line 16 in D:\phpStudy\WWW\MYSQL2\1.php on line 16
Warning: mysqli::__construct(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: NO) in D:\phpStudy\WWW\MYSQL2\1.php on line 12
Warning: var_dump(): Property access is not allowed yet in D:\phpStudy\WWW\MYSQL2\1.php on line 13
Warning: var_dump(): Property access is not allowed yet in D:\phpStudy\WWW\MYSQL2\1.php on line 13
Warning: var_dump(): Couldn't fetch mysqli in D:\phpStudy\WWW\MYSQL2\1.php on line 13
Warning: var_dump(): Couldn't fetch mysqli in D:\phpStudy\WWW\MYSQL2\1.php on line 13
Warning: var_dump(): Property access is not allowed yet in D:\phpStudy\WWW\MYSQL2\1.php on line 13
Warning: var_dump(): Couldn't fetch mysqli in D:\phpStudy\WWW\MYSQL2\1.php on line 13
Warning: var_dump(): Couldn't fetch mysqli in D:\phpStudy\WWW\MYSQL2\1.php on line 13
Warning: var_dump(): Couldn't fetch mysqli in D:\phpStudy\WWW\MYSQL2\1.php on line 13
Warning: var_dump(): Couldn't fetch mysqli in D:\phpStudy\WWW\MYSQL2\1.php on line 13
Warning: var_dump(): Couldn't fetch mysqli in D:\phpStudy\WWW\MYSQL2\1.php on line 13
Warning: var_dump(): Couldn't fetch mysqli in D:\phpStudy\WWW\MYSQL2\1.php on line 13
Warning: var_dump(): Property access is not allowed yet in D:\phpStudy\WWW\MYSQL2\1.php on line 13
Warning: var_dump(): Couldn't fetch mysqli in D:\phpStudy\WWW\MYSQL2\1.php on line 13
Warning: var_dump(): Couldn't fetch mysqli in D:\phpStudy\WWW\MYSQL2\1.php on line 13
Warning: var_dump(): Couldn't fetch mysqli in D:\phpStudy\WWW\MYSQL2\1.php on line 13
Warning: var_dump(): Couldn't fetch mysqli in D:\phpStudy\WWW\MYSQL2\1.php on line 13
object(mysqli)#1 (19) { ["affected_rows"]=> NULL ["client_info"]=> NULL ["client_version"]=> int(50012) ["connect_errno"]=> int(1045) ["connect_error"]=> string(62) "Access denied for user 'root'@'localhost' (using password: NO)" ["errno"]=> NULL ["error"]=> NULL ["error_list"]=> NULL ["field_count"]=> NULL ["host_info"]=> NULL ["info"]=> NULL ["insert_id"]=> NULL ["server_info"]=> NULL ["server_version"]=> NULL ["stat"]=> NULL ["sqlstate"]=> NULL ["protocol_version"]=> NULL ["thread_id"]=> NULL ["warning_count"]=> NULL }
D:\phpStudy>mysql -uroot -p
Enter password: ******
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.5.53 MySQL Community Server (GPL)
Copyright (c) 2000, 2016, 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> use test4;
Database changed
mysql>
数据库也打开了 还是不行
望解决
正在回答 回答被采纳积分+1
- 参与学习 人
- 提交作业 225 份
- 解答问题 3372 个
掌握用PHP开发互联网网站的必备功能,掌握当下主流的Linux系统开发,并熟练使用热门框架ThinkPhp开发电商团购项目,是通向PHP工程师必经之路。
了解课程
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星