在Windows下安装MySQL
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

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

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 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...

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.

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...

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 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. �...

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

PHP...
