您的位置:首页 > 数据库 > MySQL

mysql安装

2015-11-13 15:38 489 查看
1、

百度软件上下载了mysql版本

mysql-5.6.24-win32.1432006610.zip

2、

解压缩到目录:

E:\tool\mysql-5.6.24-win32.1432006610\mysql-5.6.24-win32

3、

然后在目录下创建mycommand.bat用来快捷进入目录。

Mycommand.bat内容:

Cmd

//注意cmd后面回车行。

4、

启动服务

E:\tool\mysql-5.6.24-win32.1432006610\mysql-5.6.24-win32>cd bin

E:\tool\mysql-5.6.24-win32.1432006610\mysql-5.6.24-win32\bin>mysqld.exe

2015-11-13 15:16:24 0 [Warning] TIMESTAMP with implicit DEFAULT value is depreca

ted. Please use --explicit_defaults_for_timestamp server option (see documentati

on for more details).

2015-11-13 15:16:24 0 [Note] mysqld.exe (mysqld 5.6.24) starting as process 5344

...

如上显示表示服务已经启动。

5、

验证数据库

E:\tool\mysql-5.6.24-win32.1432006610\mysql-5.6.24-win32\bin>mysqladmin --version

mysqladmin Ver 8.42 Distrib 5.6.24, for Win32 on x86

如上显示mysql的版本号码

6、

使用MySQL客户端执行简单的SQL命令

E:\tool\mysql-5.6.24-win32.1432006610\mysql-5.6.24-win32\bin>mysql

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 1

Server version: 5.6.24 MySQL Community Server (GPL)

Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its

affiliates. Other names may be trademarks of their respective

owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show databases;

+--------------------+

| Database |

+--------------------+

| information_schema |

| test |

+--------------------+

以上是显示数据库信息的sql语句。

7、

数据库安装后会有一个root的空密码的用户,需要重新设置密码,以下是对root的重新设定密码1,然后再用root登录mysql

E:\tool\mysql-5.6.24-win32.1432006610\mysql-5.6.24-win32\bin>mysqladmin -u root

password "1"

Warning: Using a password on the command line interface can be insecure.

E:\tool\mysql-5.6.24-win32.1432006610\mysql-5.6.24-win32\bin>mysql -u root -p

Enter password: *

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 6

Server version: 5.6.24 MySQL Community Server (GPL)

Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its

affiliates. Other names may be trademarks of their respective

owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> exit

Bye

E:\tool\mysql-5.6.24-win32.1432006610\mysql-5.6.24-win32\bin>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: