PHP8.1已发布!
糊涂粥 于 2022-01-24 20:48:26


php8.1

已发布!

PHP 8.1 是 PHP 语言的一个主版本更新。
它包含了许多新功能,包括枚举、只读属性、First-class 可调用语法、纤程、交集类型和性能改进等。


2022新年快乐!
糊涂粥 于 2022-01-01 10:44:39

0033ImPzly1gxxg9b628zj60u01b7tp402

Thinkphp更新到了6.0.9,我升级后发现原来运行正常的代码会报类似这样的错误

think\db\baseQuery::jsonResult(): Argument #1 ($result) must be of type array.....

发现是因为升级过程中,

topthink/think-orm 从2.0.44升级到了2.0.45,将期版本降级至2.0.44,问题就可以解决。

如果已经升级了应该怎么降级呢?

将composer.json文件中的

"topthink/think-orm": "^2.0"

改为

"topthink/think-orm": "2.0.44"

然后运行

 composer update
即可。
MySQL 8 的安装
糊涂粥 于 2021-10-27 21:19:39

MySQL 的下载地址:MySQL :: Download MySQL Community Server

得到的压缩包解压后,打开命令行提示符的管理员模式。

安装mysql服务:

D:\Server\MySQL\mysql-8.0.27-winx64\bin>mysqld --install
Service successfully installed.

初始化mysql

D:\Server\MySQL\mysql-8.0.27-winx64\bin>mysqld --initialize --console
2021-10-27T12:44:56.110412Z 0 [System] [MY-013169] [Server] D:\Server\MySQL\mysql-8.0.27-winx64\bin\mysqld.exe (mysqld 8.0.27) initializing of server in progress as process 9472
2021-10-27T12:44:56.441555Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2021-10-27T12:45:04.292406Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
2021-10-27T12:45:16.275942Z 0 [Warning] [MY-013746] [Server] A deprecated TLS version TLSv1 is enabled for channel mysql_main
2021-10-27T12:45:16.276340Z 0 [Warning] [MY-013746] [Server] A deprecated TLS version TLSv1.1 is enabled for channel mysql_main
2021-10-27T12:45:16.423013Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: <H2MriERvPHB

root用户的初始密码是:<H2MriERvPHB

使用初始密码登录root用户

D:\Server\MySQL\mysql-8.0.27-winx64\bin>mysql -uroot -p
Enter password: ************
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.27

Copyright (c) 2000, 2021, Oracle and/or its affiliates.

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>

需要先修改密码,同时修改mysql8的密码验证方式,否则第三方工具可能连接不上

mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456789';
Query OK, 0 rows affected (0.12 sec)<br/>

刷新权限

mysql>  flush privileges;
Query OK, 0 rows affected (0.11 sec)

好了,可以链接了

enjoy!