安装mysql
https://dev.mysql.com/doc/mysql-apt-repo-quick-guide/en/ 参照官网,添加安装源
查看数据库状态
huanyu@ubuntu:~/Downloads$ sudo service mysql status

启动数据库
huanyu@ubuntu:~/Downloads$ sudo service mysql start
停止数据库
huanyu@ubuntu:~/Downloads$ sudo service mysql stop
进入mysql数据库
huanyu@ubuntu:~/Downloads$ mysql -uroot -proot

查看所有数据库
show databases;

选择需要操作的数据库,比如test
use test;
并不需要关键字database

查看表结构
desc student;

查看所有表
show tables;

网友评论