MySQL的介绍及MySQL的安装

MySQL 介绍
MySQL 是一个 DBMS(数据库管理系统),由瑞典 MySQLAB 公司开发,目前属于 Oracle 公司,MySQL 是最流行的关系型数据库管理系统(关系数据库,是建立在关系数据库模型基础上的数据库,借助于集合代数等概念和方法来处理数据库中的数据)。由于其体积小、速度快、总体拥有成本低,尤其是开放源码这一特点,一般中小型网站的开发者都选择 MySQL 作为网站数据库。MySQL 使用 SQL 语言进行操作。

MySQL安装
在Ubuntu上安装MySQL,最简单的方式是在线安装。只需要几行简单的命令( # 号后面是注释):

#安装 MySQL 服务端、核心程序
sudo apt-get install mysql-server

#安装 MySQL 客户端
sudo apt-get install mysql-client  

连接到MySQL服务器
mysql -u root -p
huabuxiu@huabuxiu-virtual-machine:~$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 17
Server version: 5.7.20-0ubuntu0.16.04.1 (Ubuntu)

Copyright (c) 2000, 2017, 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>
简单的使用MySQL
查看数据库,命令为 
show databases;

连接数据库,选择其中的一个数据库,命令的语句格式为 
use <数据库的名字>

查看数据表,命令
show tables;
查看数据库中间有哪些表

退出MySQL,命令为
quit或者exit


猜你喜欢

转载自blog.csdn.net/huabuxiu/article/details/79856765
今日推荐