Home Database Mysql Tutorial 演示MySQL数据库的安装和操作(组图)_MySQL

演示MySQL数据库的安装和操作(组图)_MySQL

Jun 01, 2016 pm 02:04 PM
mysql Install operate database Demo Table of contents

mysql安装

本文图文并貌的示范了数据库的安装和操作。

一、MySQL下载与安装

 

1、下载介绍:

 

 

· 关于镜像网站,没有大陆的,有香港和台湾的。选择它,是为了加快下载速度,不过也不是绝对的,我经常就从北美的镜像下载,速度反而更快些。

 

· MySQL数据库服务器 这里我选择MySQL 4.1版本。版本太低,许多新特性用不上;太高,测试还没有完善,容易出Bug。这里选择它推荐的。

 

点击这个链接,进入下载页面,可以看到,当前版本是4.1.8。找到“Windows downloads”,如图,因为我使用的是Windows平台。这里我选择“Without installer (unzip in C:\)”这个版本,因为我喜欢不需要安装的软件,用的不高兴,随时可以直接删除,当然需要自己配置一下才能使用。

 

点击“Pick a mirror”,进入一个页面,那里的表格可以不填,直接选择一个链接下载它就可以了。下载后的文件名是“mysql-4.1.8-win-noinstall.zip”,大小是35.2MB。

 

 

· 关于“Graphical clients” 图形界面的客户端,选择一个吧,可以进行图形化操作,何乐而不为?只不过以前我一直用“MySQL Control Center”的,现在却不开发了。选择“MySQL Administrator”吧,下载后的文件名是“mysql-administrator-1.0.19-win-noinstall.zip”(这里我选择的是不需要安装版本),大小是4.5M。

 

同样也选择“MySQL Query Browser”,它是来查询的。下载后的文件名是“mysql-query-browser-1.1.5-win-noinstall.zip”(不需要安装版本),大小是4.5MB。

 

关于这方面的软件比较多,如:MySQL-Front,EMS MySQL Manager等,比较好用,不过它们是要Money的。

 

· “Application Programming Interfaces (APIs) ” 应用程序接口 由于我主要是面向Java应用,所以这里就选择“MySQL Connector/J ”,版本选择“MySQL Connector/J 3.0”,因为它是“Procdution”版本。下载后的文件名是“mysql-connector-java-3.0.16-ga.zip”,大小是1.2MB。

 

2、安装MySQL:

 

· 找到下载后的mysql-4.1.8-win-noinstall.zip,解压到D盘,是一个“mysql-4.1.8-win”文件夹,这里我把它改名为“mysql”,因为我不喜欢带版本号。即这时是“D:\mysql”目录,这个目录下有一个“data”目录,这里就是存放数据的地方。为了方便备份和升级,最好把它放在其它地方。这里我在D盘新建一个目录“mysql-data”,然后把“D:\mysql”目录下的“data”子目录剪切到“D:\mysql-data”目录中。

 

·新建一个“my.ini”文件,注意后缀名是“ini”。内容如下:

 

<ccid_code></ccid_code>E:\WINDOWS\my.ini

[WinMySQLAdmin]

Server=D:/mysql/bin/mysqld-nt.exe

[mysqld]

basedir=D:/mysql

datadir=D:/mysql-data/data
Copy after login

上面“Server”指向MySQL的执行主程序,“basedir”指向MySQL的安装目录,“datadir”指向MySQL的数据存放目录(因为我改变了它,所以需要特别指定)。

 

然后把这个文件移动到Windows的系统安装目录下,我这里是“E:\WINDOWS”。

· 打开MS-DOS窗口,切换到“D:\mysql\bin”目录;或者把“D:\mysql\bin”添加到“环境变量”的“Path”变量中,这样可以避免切换到“D:\mysql\bin”目录。

 

·加入到Windows XP的服务中:D:\mysql\bin> mysqld-nt -install。

 

(这时打开“控制面板”->管理工具->服务:可以看到服务列表中存在“MySQL”服务,如果不希望它自动执行,可以改为手动,不用它的时候可以节省点内存)

 

 

· 启动和停止MySQL服务:

 

<ccid_code></ccid_code>D:\mysql\bin>net start mysql 

D:\mysql\bin>net stop mysql
Copy after login

 

 

· 移出MySQL服务:mysqld-nt --remove。

 

(如果你不再需要MySQL了,先停止MySQL服务,然后再移出MySQL服务,最后删除MySQL安装目录即可)

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

Repo: How To Revive Teammates
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
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 尊渡假赌尊渡假赌尊渡假赌

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 use MySQL backup and restore in PHP? How to use MySQL backup and restore in PHP? Jun 03, 2024 pm 12:19 PM

Backing up and restoring a MySQL database in PHP can be achieved by following these steps: Back up the database: Use the mysqldump command to dump the database into a SQL file. Restore database: Use the mysql command to restore the database from SQL files.

How to optimize MySQL query performance in PHP? How to optimize MySQL query performance in PHP? Jun 03, 2024 pm 08:11 PM

MySQL query performance can be optimized by building indexes that reduce lookup time from linear complexity to logarithmic complexity. Use PreparedStatements to prevent SQL injection and improve query performance. Limit query results and reduce the amount of data processed by the server. Optimize join queries, including using appropriate join types, creating indexes, and considering using subqueries. Analyze queries to identify bottlenecks; use caching to reduce database load; optimize PHP code to minimize overhead.

How to insert data into a MySQL table using PHP? How to insert data into a MySQL table using PHP? Jun 02, 2024 pm 02:26 PM

How to insert data into MySQL table? Connect to the database: Use mysqli to establish a connection to the database. Prepare the SQL query: Write an INSERT statement to specify the columns and values ​​to be inserted. Execute query: Use the query() method to execute the insertion query. If successful, a confirmation message will be output.

How to create a MySQL table using PHP? How to create a MySQL table using PHP? Jun 04, 2024 pm 01:57 PM

Creating a MySQL table using PHP requires the following steps: Connect to the database. Create the database if it does not exist. Select a database. Create table. Execute the query. Close the connection.

How to use MySQL stored procedures in PHP? How to use MySQL stored procedures in PHP? Jun 02, 2024 pm 02:13 PM

To use MySQL stored procedures in PHP: Use PDO or the MySQLi extension to connect to a MySQL database. Prepare the statement to call the stored procedure. Execute the stored procedure. Process the result set (if the stored procedure returns results). Close the database connection.

How to fix mysql_native_password not loaded errors on MySQL 8.4 How to fix mysql_native_password not loaded errors on MySQL 8.4 Dec 09, 2024 am 11:42 AM

One of the major changes introduced in MySQL 8.4 (the latest LTS release as of 2024) is that the &quot;MySQL Native Password&quot; plugin is no longer enabled by default. Further, MySQL 9.0 removes this plugin completely. This change affects PHP and other app

iOS 18 adds a new 'Recovered' album function to retrieve lost or damaged photos iOS 18 adds a new 'Recovered' album function to retrieve lost or damaged photos Jul 18, 2024 am 05:48 AM

Apple's latest releases of iOS18, iPadOS18 and macOS Sequoia systems have added an important feature to the Photos application, designed to help users easily recover photos and videos lost or damaged due to various reasons. The new feature introduces an album called "Recovered" in the Tools section of the Photos app that will automatically appear when a user has pictures or videos on their device that are not part of their photo library. The emergence of the "Recovered" album provides a solution for photos and videos lost due to database corruption, the camera application not saving to the photo library correctly, or a third-party application managing the photo library. Users only need a few simple steps

Detailed tutorial on establishing a database connection using MySQLi in PHP Detailed tutorial on establishing a database connection using MySQLi in PHP Jun 04, 2024 pm 01:42 PM

How to use MySQLi to establish a database connection in PHP: Include MySQLi extension (require_once) Create connection function (functionconnect_to_db) Call connection function ($conn=connect_to_db()) Execute query ($result=$conn->query()) Close connection ( $conn->close())

See all articles