Home php教程 php手册 在Windows下安装MySQL

在Windows下安装MySQL

Jun 21, 2016 am 09:13 AM
http mysql nbsp windows

mysql|window

本文只讨论如何在Windows NT 4.0或Windows 20000下安装MySQL。
我用的MySQL为mysql-shareware-3.22.32-win.zip。
一、软件下载
    您可以从下列站点下载Windows版本的MySQL数据库服务器软件:
       http://www.mysql.com/download_win.html
       http://chat.hn.cninfo.net/soft/
二、软件安装
    您可以从http://www.mysql.com/Manual/manual.html#Win32获取详细的安装
方法。您可以用下面的方法进行安装:
    1、将下载的软件用WinZIP等.zip解压缩工具解压缩到一个临时目录,如C:\TEMP,
在这里用$INSTALL_TEMP标识;
    2、双击$INSTALL_TEMP目录下的SETUP.EXE进行安装,安装的时候,系统要您确定
安装的目的地,缺省为c:\mysql,在这里用$MYSQL标识;
    3、将$MYSQL目录下的my-example.cnf文件拷贝为c:\my.cnf,用文本编辑器打开
c:\my.cnf,把该文件中的#basedir = d:/mysql/改为basedir = $MYSQL,$MYSQL
用您那里的安装目的地目录代替;
    4、运行cmd或command,打开command窗口;
    5、在command窗口中进入$MYSQL\bin目录,如:cd c:\mysql\bin;
    6、运行mysqld-shareware --install,这样在Windows的服务中就多了一个名为
MySQL的服务,您可以用Windows的服务管理程序来启动或停止服务;
    7、现在请用Windows的服务管理程序启动MySQL数据库服务;
    8、MySQL安装完后,root账号的密码为空,这时候您可以用下面的方法来改变root
账号的密码:mysqladmin -u root -p password ,它会要求您输入root账
号的旧密码;
    9、这时您就可以用下面的方法来测试是否已经安装成功了:mysql -u root -p,
它会要求您输入root账号的密码,如果MySQL已经安装成功,您就会看到下面这段话:
          C:\mysql\bin>mysql -u root -p
          Enter password: ****
          Welcome to the MySQL monitor.  Commands end with ; or \g.
          Your MySQL connection id is 3 to server version: 3.22.32-shareware-debug

          Type 'help' for help.

          mysql>
       这时您可以在mysql>提示符下按这样的方法进行测试:
          mysql> show databases
              -> go
          +----------+
          | Database |
          +----------+
          | mysql    |
          | test     |
          +----------+
          2 rows in set (0.05 sec)

          mysql> use test
          Database changed
          mysql> create table test(name char(50))
              -> go
          Query OK, 0 rows affected (0.12 sec)

          mysql> insert into test(name) values('朋友,您好,欢迎使用MySQL')
              -> go
          Query OK, 1 row affected (0.07 sec)

          mysql> select * from test
              -> go
          +---------------------------+
          | name                      |
          +---------------------------+
          | 朋友,您好,欢迎使用MySQL |
          +---------------------------+
          1 row in set (0.02 sec)

          mysql> exit
          Bye

          C:\mysql\bin>

附:
    MySQL下载网址
       http://www.mysql.com/download_win.html
       http://chat.hn.cninfo.net/soft/
    MySQL安装指南
       http://www.mysql.com/Manual/manual.html#Win32
    MySQL手册
       http://www.mysql.com/Manual/manual_toc.html
       http://www.mysql.com/Manual/manual.html



Statement of this Website
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)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
Two Point Museum: All Exhibits And Where To Find Them
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to solve the problem of third-party interface returning 403 in Node.js environment? How to solve the problem of third-party interface returning 403 in Node.js environment? Mar 31, 2025 pm 11:27 PM

Solve the problem of third-party interface returning 403 in Node.js environment. When we use Node.js to call third-party interfaces, we sometimes encounter an error of 403 from the interface returning 403...

The page is blank after PHP is connected to MySQL. What is the reason for the invalid die() function? The page is blank after PHP is connected to MySQL. What is the reason for the invalid die() function? Apr 01, 2025 pm 03:03 PM

The page is blank after PHP connects to MySQL, and the reason why die() function fails. When learning the connection between PHP and MySQL database, you often encounter some confusing things...

How to download okx trading platform How to download okx trading platform Mar 26, 2025 pm 05:18 PM

The OKX trading platform can be downloaded through mobile devices (Android and iOS) and computers (Windows and macOS). 1. Android users can download it from the official website or Google Play, and they need to pay attention to security settings. 2. iOS users can download it through the App Store or follow the official announcement to obtain other methods. 3. Computer users can download the client of the corresponding system from the official website. Always make sure to use official channels when downloading, and register, log in and security settings after installation.

How to efficiently integrate Node.js or Python services under LAMP architecture? How to efficiently integrate Node.js or Python services under LAMP architecture? Apr 01, 2025 pm 02:48 PM

Many website developers face the problem of integrating Node.js or Python services under the LAMP architecture: the existing LAMP (Linux Apache MySQL PHP) architecture website needs...

PHP optimistic locking combined with transaction deduction balance failed: How to ensure that the balance is correctly deducted in concurrency situations? PHP optimistic locking combined with transaction deduction balance failed: How to ensure that the balance is correctly deducted in concurrency situations? Mar 31, 2025 pm 11:42 PM

Detailed explanation of the problem of deducting balances in combination with PHP optimistic locks and transactions in this article will analyze in detail a balance deduction using PHP, optimistic locks and database transactions, only...

How to avoid third-party interfaces returning 403 errors in Node environment? How to avoid third-party interfaces returning 403 errors in Node environment? Apr 01, 2025 pm 02:03 PM

How to avoid the third-party interface returning 403 error in the Node environment. When calling the third-party website interface using Node.js, you sometimes encounter the problem of returning 403 error. �...

What should I do if Beyond Compare fails to case sensitivity when synchronizing Windows and Linux files? What should I do if Beyond Compare fails to case sensitivity when synchronizing Windows and Linux files? Apr 01, 2025 am 08:06 AM

The problem of comparing and synchronizing BeyondCompare files: Case sensitivity failure when using Beyond...

See all articles