MySQL基础(1)
1有默认的四个库
2 先建库,再建表
建表注意事项
3远程链接数据库
方式二 用 xshell
输入用户名和密码,根据黑窗口 进行操作
1 cd /home
2 ll 显示文件
3 cd .. 退回上一级
4 mysql -uroot -p
Enter password: root
进入mysql
5show databases;
显示数据库
6use test
打开某一个数据库
7 show tables
显示数据库下的表
8mysql> CREATE TABLE `user` (
-> `id` int(20) NOT NULL,
-> `name` varchar(50) DEFAULT NULL,
-> `password` varchar(100) DEFAULT NULL,
-> `type` varchar(50) DEFAULT NULL
-> ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Query OK, 0 rows affected (0.11 sec)
执行语句
9drop table 表名
10exit 结束