2024-03-14
MySQL
00

SQL 查询

将练习数据 world.sql 导入数据库中

SQL
source world.sql;

查看表

SQL
show tables; +-----------------+ | Tables_in_world | +-----------------+ | city | | country | | countrylanguage | +-----------------+ 3 rows in set (0.00 sec)
2024-03-14
MySQL
00

行数据的增删改查

  • insert
  • delete
  • update
  • select

创建库

SQL
create database linux;
2024-03-13
MySQL
00

MySQL 数据类型

查看表类型

shell
desc songs; +---------+--------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +---------+--------------+------+-----+---------+----------------+ | id | int(11) | NO | PRI | NULL | auto_increment | | name | varchar(255) | YES | | NULL | | | url | varchar(255) | YES | | NULL | | | lrc | text | YES | | NULL | | | song_id | int(11) | YES | | NULL | | +---------+--------------+------+-----+---------+----------------+ 5 rows in set (0.002 sec)
2024-03-12
MySQL
00

MySQL 更新

CentOS 7 默认安装的是 MariaDB-5.5.68 或者 65。

查看版本的指令:

bash
rpm -qa | grep mariadb

修改 yum 源的配置文件

bash
vim /etc/yum.repos.d/mariadb.repo i[mariadb] name=mariadb laster version baseurl=http://mirrors.tuna.tsinghua.edu.cn/mariadb/yum/10.6/centos7-amd64/ gpgcheck=0
2024-03-12
MySQL
00

MySQL 安装、简单使用

mysql 以前是一款开源的软件,收费的商业版数据库是 oracle,之前互联网发起了去 ioe 项目,o 就是 oracle,很贵。i 是 IBM 硬件、 E是 EMC 存储设备都很贵,所以好多公司发起了这个行动,这也是大家倾向于开源软件的一个原因。后来mysql 发展很好,市场占有量也变的比较大了,国内用的特别多,oracle 一看不行,10个亿美元收购了 mysql,但是 mysql 的创始人没闲着,按照 mysql 的标准又创建了一个数据库软件,mariadb,和 mysql 的用法是基本一样的,所有的操作指令都是之前 mysql 的。maria 是创始人的孙女。