多语言展示
当前在线:1264今日阅读:117今日分享:28

MySQL数据库创建数据表前期工作

MySQL数据库创建数据表前期工作
工具/原料

MySQL数据库

方法/步骤
1

步骤一:添加MYSQL的环境变量右击我的电脑-属性-高级-环境变量-找到path,点击编辑,将C:或D:盘下的MYSQL的mysql/mysql server 5.6/bin的路径添加到path中

2

步骤二:登陆MYSQL开始-运行-cmd-,在DOS环境下输入mysql  –h  localhost  –u  root  -p,输入密码,看到mysql>说明登陆成功。C:\Documents and Settings\kwt>mysql -h localhost -u root -pEnter password: ***Welcome to the MySQL monitor.  Commands end with ; or \g.Your MySQL connection id is 223Server version: 5.5.50 MySQL Community Server (GPL)Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql>

3

步骤三:创建一个不存在的数据库(若已存在,此步骤省略)本例:创建学生成绩数据库,数据库名为“wang”mysql> CREATE DATABASE wang;Query OK, 1 row affected (0.03 sec) mysql>  出现OK表示创建数据库成功

4

步骤四:指定当前操作的数据库(每次操作数据表时必须先做的步骤)指定学生成绩数据库“xscj”为当前操作数据库mysql> USE wang;Database changed  当前数据库改变成功mysql>

推荐信息