前言
有一说一,PHPstudy安装和配置都要比xampp要简单的多,而且软件的页面看着也比较舒服。
以前装xampp的时候也是挺无语的。
活不多说,开整。
下载
官网链接:https://www.xp.cn
下载完后点击exe文件安装即可
也可自定义安装到自己想要的位置
打开Apache和MySQL
这里访问localhost或者127.0.0.1都可以,如果还打不开的话就加上端口号。
配置
Win+x打开系统,打开高级设置,打开环境变量
一点要点击确定,不要直接关掉,不然就没有用。
我在配置中遇到的问题
Win+x打开Windows终端
安装最新的 PowerShell,了解新功能和改进!https://aka.ms/PSWindows
PS C:\Users\86135> cd C:\Apps\phpstudy_pro\Extensions\MySQL5.7.26\bin
PS C:\Apps\phpstudy_pro\Extensions\MySQL5.7.26\bin> mysql -uroot -p
mysql : 无法将“mysql”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正
确,然后再试一次。
所在位置 行:1 字符: 1
+ mysql -uroot -p
+ ~~~~~
+ CategoryInfo : ObjectNotFound: (mysql:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Suggestion [3,General]: 找不到命令 mysql,但它确实存在于当前位置。默认情况下,Windows PowerShell 不会从当前位置加载命令
。如果信任此命令,请改为键入“.\mysql”。有关详细信息,请参阅 "get-help about_Command_Precedence"。
PS C:\Apps\phpstudy_pro\Extensions\MySQL5.7.26\bin> ./mysql -uroot -proot
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 17
Server version: 5.7.26 MySQL Community Server (GPL)
Copyright (c) 2000, 2019, 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>
在这里必须先转到数据库文件里面:
我的路径是:C:\Apps\phpstudy_pro\Extensions\MySQL5.7.26\bin
如果输入:mysql -uroot -proot失败,那就输入:./ mysql -uroot -proot
密码默认为root。
OK,这样数据库就配置成功了。