安装
首先进入linux的root权限;
输入:sudo apt-get install mysql-server 命令;
安装完成后会有密码设置,填好之后按Tab键确定回车;
然后输入:mysql -uroot -p(密码) 注意p与密码之间不留空格
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 44
Server version: 5.5.37-0ubuntu0.14.04.1 (Ubuntu)
Copyright (c) 2000, 2014, 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>
出现这些说明数据库已经安装好了。
数据库的基本操作
创建 查看 删除
创建:create database database-name;//不分大小写
查看:(两种)
一是查看某个定义的库:show create database database-name;
而是查看所有的库:show databases;
删除:drop database database-name;//注意一旦删除将无法恢复
use database;//使用该表;
查看存储引擎
show engines;