我只是擦了擦Mac,然后重新安装了El Capitan。我正在努力连接到Mysql。经历了Web服务器设置过程之后,我创建了一个简单的PHP测试文件:
<?php
$conn = new mysqli("127.0.0.1", "root", "xxxxxxxx");
if ($conn->connect_error) echo "Connection failed: " . $conn->connect_error;
else echo "Connected successfully";
phpinfo();
?>
运行它时,出现以下错误:
Warning: mysqli::mysqli(): (HY000/1862): Your password has expired. To log in you must change it using a client that supports expired passwords. in /Users/rich/Documents/DESIGN/test/index.php on line 3
Connection failed: Your password has expired. To log in you must change it using a client that supports expired passwords.
我以前从未见过来自连接的响应。如果无法连接该如何解决?
编辑
在终端中,我输入了以下命令:
mysql -u root -p
这要求我输入我的密码(当前密码)。我现在可以访问mysql命令,但是我尝试执行的任何操作都会导致此错误:
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
如何使用重置密码ALTER USER
?