MySQL服务安装及命令使用

1.安装

安装的话,在线安装就可以

apt-get install MySQL-server MySQL-client

 

2.启动服务器

sudo service mysql start

 

3.登录mysql (-u代表用户user,以root这个用户登录)

mysql -u root

 

4.退出mysql服务

quit

 

5.查询版本

select version()

 

6.提示符的含义

1.等待分号;
mysql>select user()
        ->

2.等待引号'
mysql>select * from family where name ='smith and age <30
        '>

3.等待双引号"
mysql>select * from family where name ="smith and age <30
        ">


走到这一步,应该怎样做呢?
1. 进行补全
2. 输入命令 \c 进行取消命令

 

posted @ 2017-08-05 22:07  小小宇小小灰  阅读(396)  评论(0编辑  收藏  举报