search
Homephp教程php手册如何在 Dos 下运行 PHP 和 MySQL 命令

1、配置 PHP 如果想在 Dos 下运行 PHP 文件,必须把 PHP 的安装目录添加到环境变量中。步骤如下: 我的电脑 - 属性 - 高级 - 环境变量 - 系统变量,如图: 首先,先观察变量 Path 是否存在,如果不存在的话,可以点击“新建”一个;如果存在并且已经有的话,

1、配置 PHP

如果想在 Dos 下运行 PHP 文件,必须把 PHP 的安装目录添加到环境变量中。步骤如下:

我的电脑 - 属性 - 高级 - 环境变量 - 系统变量,如图:

如何在 Dos 下运行 PHP 和 MySQL 命令

首先,先观察变量 Path 是否存在,如果不存在的话,可以点击“新建”一个;如果存在并且已经有值的话,选中 Path,点击“编辑”,把您电脑里面的 PHP 安装路径追加到已有的 Path 值后即可,注意:使用英文(分号)“;”相隔。

完成上面的操作,您就可以在 Dos 中运行 PHP 文件了,直接在 Dos 键入:php xx.php 即可!

2、配置 MySQL

在环境变量 Path 中添加 MySQL 的 bin 目录即可。

比如:MySQL 的安装路径为:F:\php\mysql,那么在 Path 中就应该添加:;F:\php\mysql\bin

完成后重启 DOS,键入命令:“mysql -u 用户名 -p密码 数据库”   就可以进入MySQL 管理界面

比如:mysql -u root -p1715544 test   // 进入test 数据库(注:参数-p和后面的密码之间没有空格)
如何在 Dos 下运行 PHP 和 MySQL 命令

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
Will R.E.P.O. Have Crossplay?
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Atom editor mac version download

Atom editor mac version download

The most popular open source editor