Home Database Mysql Tutorial MYSQL完全入门(Windows版)_MySQL

MYSQL完全入门(Windows版)_MySQL

Jun 01, 2016 pm 01:47 PM
linux windows yes

bitsCN.com

一、MySQL简介
MySQL是一个小巧灵珑的数据库服务器软件,对于中、小型应用系统是非常理想的。除了支持标准的ANSI SQL语句外,最重要的是,它还支持多种平台,而在Unix/Linux系统上,MySQL支持多线程运行方式,从而能获得相当好的性能。它和前两个软件一样,是属于开放源代码软。
二、MySQL的安装(指Windows版本)
将下载后的文件解压,到一个目录,运行Setup程序,会提示整个安装的过程。它默认安装到c:mysql下,如果要安装到其它目录下还有改动一些东西,作为初学者,可以先不管,以默认的目录安装。好了,安装后,进入c:mysqlin目录下,运行mysqld-shareware.exe文件
在Win98下直接运行,正常情况下,没有什么提示信息
在NT下可以输入:mysqld-shareware --install 启动该服务
接着,输入mysql ,正常情况下会出现几行提示信息并出现下提示符号:
mysql>
到此,你已经成功安装了MySQL。
三、设置MySQL用户密码
MySQL数据库的默认用户名为“root”(MS SQL Server 的 sa 相似),密码默认为空。在DOS提示符(注意,不是mysql提示符)下输入
c:mysqlin>“mysqladmin -u root -p password adminpassword
回车后会提示你输入原来的密码,由于原来密码为空,直接回车,root用户的密码便改为“adminpassword”了。
四、简单使用MySQL数据库
1.显示MySQL的数据库(注意:在该文的以后部分,如果没有提示,输入的命令都是在mysql提示符下)
show databases
2.打开一个数据库
use test
其中,test为数据库名称
3.显示一个数据库中所有数据表 (必须先打开一个数据库)
show tables
go
4.以root身份创建一个数据库(在DOS提示符号下)
mysqladmin -u root -p password adminpassword create gsbook
接着会提示你输入密码。因为,我们的目的是做一个留言板,我在这里将数据库的名称命名为“gsbook”。
5.在数据库中加入数据表
create table gsbook(id int not null auto_increment,primary key(id),nickname varchar(30),email varchar(30),homepage varchar(30),note text,w_time datetime)


 

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

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
3 weeks 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)

Hot Topics

Java Tutorial
1664
14
PHP Tutorial
1269
29
C# Tutorial
1248
24
Linux Architecture: Unveiling the 5 Basic Components Linux Architecture: Unveiling the 5 Basic Components Apr 20, 2025 am 12:04 AM

The five basic components of the Linux system are: 1. Kernel, 2. System library, 3. System utilities, 4. Graphical user interface, 5. Applications. The kernel manages hardware resources, the system library provides precompiled functions, system utilities are used for system management, the GUI provides visual interaction, and applications use these components to implement functions.

How to check the warehouse address of git How to check the warehouse address of git Apr 17, 2025 pm 01:54 PM

To view the Git repository address, perform the following steps: 1. Open the command line and navigate to the repository directory; 2. Run the "git remote -v" command; 3. View the repository name in the output and its corresponding address.

How to run java code in notepad How to run java code in notepad Apr 16, 2025 pm 07:39 PM

Although Notepad cannot run Java code directly, it can be achieved by using other tools: using the command line compiler (javac) to generate a bytecode file (filename.class). Use the Java interpreter (java) to interpret bytecode, execute the code, and output the result.

How to run sublime after writing the code How to run sublime after writing the code Apr 16, 2025 am 08:51 AM

There are six ways to run code in Sublime: through hotkeys, menus, build systems, command lines, set default build systems, and custom build commands, and run individual files/projects by right-clicking on projects/files. The build system availability depends on the installation of Sublime Text.

How to solve complex BelongsToThrough relationship problem in Laravel? Use Composer! How to solve complex BelongsToThrough relationship problem in Laravel? Use Composer! Apr 17, 2025 pm 09:54 PM

In Laravel development, dealing with complex model relationships has always been a challenge, especially when it comes to multi-level BelongsToThrough relationships. Recently, I encountered this problem in a project dealing with a multi-level model relationship, where traditional HasManyThrough relationships fail to meet the needs, resulting in data queries becoming complex and inefficient. After some exploration, I found the library staudenmeir/belongs-to-through, which easily installed and solved my troubles through Composer.

laravel installation code laravel installation code Apr 18, 2025 pm 12:30 PM

To install Laravel, follow these steps in sequence: Install Composer (for macOS/Linux and Windows) Install Laravel Installer Create a new project Start Service Access Application (URL: http://127.0.0.1:8000) Set up the database connection (if required)

git software installation git software installation Apr 17, 2025 am 11:57 AM

Installing Git software includes the following steps: Download the installation package and run the installation package to verify the installation configuration Git installation Git Bash (Windows only)

How to run sublime python How to run sublime python Apr 16, 2025 am 08:54 AM

How to run Python scripts in Sublime Text: Install Python interpreter configuration Interpreter path in Sublime Text Press Ctrl B (Windows/Linux) or Cmd B (macOS) to run the script If an interactive console is required, press Ctrl \ (Windows/Linux) or Cmd \ (macOS)

See all articles