mysql备份与多实例部署、
1. mysql数据库备份与恢复
1.1 数据库常用备份方案
数据库备份方案:
- 全量备份
- 增量备份
- 差异备份
备份方案 | 特点 |
---|---|
全量备份 | 全量备份就是指对某一个时间点上的所有数据或应用进行的一个完全拷贝。 数据恢复快。 备份时间长 |
增量备份 | 增量备份是指在一次全备份或上一次增量备份后,以后每次的备份只需备份 与前一次相比增加和者被修改的文件。这就意味着,第一次增量备份的对象 是进行全备后所产生的增加和修改的文件;第二次增量备份的对象是进行第一次增量 备份后所产生的增加和修改的文件,如此类推。 没有重复的备份数据 备份时间短 恢复数据时必须按一定的顺序进行 |
差异备份 | 备份上一次的完全备份后发生变化的所有文件。 差异备份是指在一次全备份后到进行差异备份的这段时间内 对那些增加或者修改文件的备份。在进行恢复时,我们只需对第一次全量备份和最后一次差异备份进行恢复。 |
/常用的OPTIONS:
-uUSERNAME //指定数据库用户名
-hHOST //指定服务器主机,请使用ip地址
-pPASSWORD //指定数据库用户的密码
-P# //指定数据库监听的端口,这里的#需用实际的端口号代替,如-P3307
//语法:
mysqldump [OPTIONS] database [tables ...]
mysqldump [OPTIONS] --all-databases [OPTIONS]
mysqldump [OPTIONS] --databases [OPTIONS] DB1 [DB2 DB3...]
备份整个数据库(全备)
备份整个数据库(全备)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| lx |
| mysql |
| performance_schema |
| sys |
+--------------------+
5 rows in set (0.01 sec)
mysql> use lx;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> show tables;
+------------------+
| Tables_in_lx |
+------------------+
| tb_course |
| tb_students_info |
+------------------+
2 rows in set (0.00 sec)
[root@192 ~]# mysqldump -uroot -p123456 --all-databases > all-$(date +%Y%m%d).sql
mysqldump: [Warning] Using a password on the command line interface can be insecure. //没有报错只是说这样密码容易暴露
[root@192 ~]# ls
all-20220731.sql anaconda-ks.cfg lx mysql-5.7.37-linux-glibc2.12-x86_64.tar.gz
//备份指定的数据库
[root@192 ~]# mysqldump -uroot -p123456 --databases lx > databases-$(date +%Y%m%d).sql
mysqldump: [Warning] Using a password on the command line interface can be insecure.
[root@192 ~]# ls
all-20220731.sql anaconda-ks.cfg databases-20220731.sql lx mysql-5.7.37-linux-glibc2.12-x86_64.tar.gz
//备份某个数据库里面的表
[root@192 ~]# mysqldump -uroot -p123456 lx tb_course > lx-$(date +%Y%m%d).sql
mysqldump: [Warning] Using a password on the command line interface can be insecure.
[root@192 ~]# ls
all-20220731.sql anaconda-ks.cfg databases-20220731.sql lx-20220731.sql
1.2数据恢复
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| lx |
| mysql |
| performance_schema |
| sys |
+--------------------+
5 rows in set (0.00 sec)
mysql> drop database lx; //直接删除整个数据库
Query OK, 2 rows affected (0.01 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| sys |
+--------------------+
4 rows in set (0.00 sec)
mysql> source all-20220731.sql //恢复数据库
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| lx |
| mysql |
| performance_schema |
| sys |
+--------------------+
5 rows in set (0.00 sec)
删除lx数据库里面的这张tb_course表
mysql> drop table tb_course;
Query OK, 0 rows affected (0.01 sec)
mysql> show tables;
+------------------+
| Tables_in_lx |
+------------------+
| tb_students_info |
+------------------+
1 row in set (0.00 sec)
mysql> source lx-20220731.sql
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
mysql> show tables;
+------------------+
| Tables_in_lx |
+------------------+
| tb_course |
| tb_students_info |
+------------------+
2 rows in set (0.00 sec)
2.差异备份与恢复
[root@192 ~]# vim /etc/my.cnf
[root@192 ~]# cat /etc/my.cnf
[mysqld]
basedir = /usr/local/mysql
datadir = /opt/data
socket = /tmp/mysql.sock
port = 3306
pid-file = /opt/data/mysql.pid
user = mysql
skip-name-resolve
server-id = 24 //服务器识别符
log-bin = mysql_bin //开启二进制日志功能
sql-mode = STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
[root@192 ~]# systemctl restart mysql.service \
>
^[[A^[[A[root@cat /etc/my.cnf.^Crvice
[root@192 ~]# systemctl restart mysql.service
[root@192 ~]# cd /opt/data/
[root@192 data]# ll
total 123008
-rw-r----- 1 mysql mysql 7 Jul 31 17:32 mysql.pid
-rw-r----- 1 mysql mysql 177 Jul 31 17:32 mysql_bin.000001 //二进制日志文件
-rw-r----- 1 mysql mysql 154 Jul 31 17:32 mysql_bin.000002
-rw-r----- 1 mysql mysql 38 Jul 31 17:32 mysql_bin.index
//对数据库进行全备
[root@192 ~]# mysqldump -uroot -p123456 --single-transaction --flush-logs --master-data=2 --all-databases --delete-master-logs > all-lx.sql
mysqldump: [Warning] Using a password on the command line interface can be insecure.
[root@192 ~]# ls
all-20220731.sql all-lx.sql anaconda-ks.cfg databases-20220731.sql lx-20220731.sql
//对数据库新增内存以便测试
mysql> create database nidaye;
Query OK, 1 row affected (0.00 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| lx |
| mysql |
| nidaye |
| performance_schema |
| sys |
+--------------------+
6 rows in set (0.00 sec)
mysql> use lx;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> select *from tb_course;
+----+-------------+
| id | course_name |
+----+-------------+
| 1 | Java |
| 2 | MySQL |
| 3 | Python |
| 4 | Go |
| 5 | C++ |
| 6 | NULL |
+----+-------------+
6 rows in set (0.00 sec)
mysql> insert into tb_course values(7,'MySql');
Query OK, 1 row affected (0.01 sec)
mysql> select *from tb_course;
+----+-------------+
| id | course_name |
+----+-------------+
| 1 | Java |
| 2 | MySQL |
| 3 | Python |
| 4 | Go |
| 5 | C++ |
| 6 | NULL |
| 7 | MySql |
+----+-------------+
7 rows in set (0.00 sec)
//准备模拟删除数据库
mysql> drop database nidaye;
Query OK, 0 rows affected (0.00 sec)
mysql> drop table tb_course;
Query OK, 0 rows affected (0.01 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| lx |
| mysql |
| performance_schema |
| sys |
+--------------------+
5 rows in set (0.00 sec)
mysql> show tables;
+------------------+
| Tables_in_lx |
+------------------+
| tb_students_info |
+------------------+
1 row in set (0.00 sec)
刷新二进制文件
[root@192 ~]# ll /opt/data/
total 123004
drwxr-x--- 2 mysql mysql 76 Jul 31 18:12 lx
drwxr-x---. 2 mysql mysql 4096 Jul 31 17:16 mysql
-rw-r----- 1 mysql mysql 7 Jul 31 17:32 mysql.pid
-rw-r----- 1 mysql mysql 921 Jul 31 18:12 mysql_bin.000003
-rw-r----- 1 mysql mysql 19 Jul 31 17:58 mysql_bin.index
...
[root@192 ~]# mysqladmin -uroot -p123456 flush-logs
mysqladmin: [Warning] Using a password on the command line interface can be insecure.
[root@192 ~]# ll /opt/data/
total 123008
-rw-r----- 1 mysql mysql 968 Jul 31 18:16 mysql_bin.000003
-rw-r----- 1 mysql mysql 154 Jul 31 18:16 mysql_bin.000004
-rw-r----- 1 mysql mysql 38 Jul 31 18:16 mysql_bin.index
drwxr-x---. 2 mysql mysql 8192 Jul 27 18:34 performance_schema
...
进行差异备份(先进行恢复全备)
[root@192 ~]# mysql -uroot -p123456 < all-lx.sql
mysql: [Warning] Using a password on the command line interface can be insecure.
[root@192 ~]# mysql -uroot -p123456 -e 'show databases;'
mysql: [Warning] Using a password on the command line interface can be insecure.
+--------------------+
| Database |
+--------------------+
| information_schema |
| lx |
| mysql |
| performance_schema |
| sys |
+--------------------+
[root@192 ~]# ll /opt/data/
total 189384
drwxr-x---. 2 mysql mysql 4096 Jul 31 18:19 mysql
-rw-r----- 1 mysql mysql 7 Jul 31 17:32 mysql.pid
-rw-r----- 1 mysql mysql 968 Jul 31 18:16 mysql_bin.000003
-rw-r----- 1 mysql mysql 859288 Jul 31 18:50 mysql_bin.000004
-rw-r----- 1 mysql mysql 154 Jul 31 18:50 mysql_bin.000005
-rw-r----- 1 mysql mysql 57 Jul 31 18:50 mysql_bin.index
[root@192 data]# mysqlbinlog --no-defaults --base64-output=decode-rows -v mysql_bin.000003 > /opt/mysql_bin003.txt //将他转换为二进制文件
差异备份的恢复方式
mysql> show binlog events in 'mysql_bin.000003';
+------------------+-----+----------------+-----------+-------------+------------------------------------------------------------+
| Log_name | Pos | Event_type | Server_id | End_log_pos | Info |
+------------------+-----+----------------+-----------+-------------+------------------------------------------------------------+
| mysql_bin.000003 | 4 | Format_desc | 24 | 123 | Server ver: 5.7.37-log, Binlog ver: 4 |
| mysql_bin.000003 | 123 | Previous_gtids | 24 | 154 | |
| mysql_bin.000003 | 154 | Anonymous_Gtid | 24 | 219 | SET @@SESSION.GTID_NEXT= 'ANONYMOUS' |
| mysql_bin.000003 | 219 | Query | 24 | 319 | create database nidaye |
| mysql_bin.000003 | 319 | Anonymous_Gtid | 24 | 384 | SET @@SESSION.GTID_NEXT= 'ANONYMOUS' |
| mysql_bin.000003 | 384 | Query | 24 | 454 | BEGIN |
| mysql_bin.000003 | 454 | Table_map | 24 | 507 | table_id: 141 (lx.tb_course) |
| mysql_bin.000003 | 507 | Write_rows | 24 | 553 | table_id: 141 flags: STMT_END_F |
| mysql_bin.000003 | 553 | Xid | 24 | 584 | COMMIT /* xid=508 */ |
| mysql_bin.000003 | 584 | Anonymous_Gtid | 24 | 649 | SET @@SESSION.GTID_NEXT= 'ANONYMOUS' |
| mysql_bin.000003 | 649 | Query | 24 | 738 | drop database nidaye |
| mysql_bin.000003 | 738 | Anonymous_Gtid | 24 | 803 | SET @@SESSION.GTID_NEXT= 'ANONYMOUS' |
| mysql_bin.000003 | 803 | Query | 24 | 921 | use `lx`; DROP TABLE `tb_course` /* generated by server */ |
| mysql_bin.000003 | 921 | Rotate | 24 | 968 | mysql_bin.000004;pos=4 |
+------------------+-----+----------------+-----------+-------------+------------------------------------------------------------+
14 rows in set (0.00 sec)
[root@192 data]# mysqlbinlog --stop-position=649 /opt/data/mysql_bin.000003 | mysql -uroot -p123456
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 1062 (23000) at line 44: Duplicate entry '7' for key 'PRIMARY'
[root@192 data]# mysql -uroot -p123456 -e 'show databases;'
mysql: [Warning] Using a password on the command line interface can be insecure.
+--------------------+
| Database |
+--------------------+
| information_schema |
| lx |
| mysql |
| nidaye |
| performance_schema |
| sys |
+--------------------+
3.MySQL多实例部署
二进制安装mysql
到官网上下载包
[root@localhost ~]# cd /usr/src/
[root@localhost src]# ls
debug kernels mysql-5.7.37-linux-glibc2.12-x86_64.tar.gz
[root@localhost src]#
解压并改名字
[root@localhost src]# tar xf mysql-5.7.37-linux-glibc2.12-x86_64.tar.gz -C /usr/local
[root@localhost src]# cd /usr/local/
[root@localhost local]# ls
bin etc games include lib lib64 libexec mysql-5.7.37-linux-glibc2.12-x86_64 sbin share src
[root@localhost local]# mv mysql-5.7.37-linux-glibc2.12-x86_64/ mysql
[root@localhost local]# ls
bin etc games include lib lib64 libexec mysql sbin share src
创建mysql用户和并修改用户和组
[root@localhost local]# groupadd -r mysql
[root@localhost local]# useradd -M -s /sbin/nologin -g mysql mysql
[root@localhost local]# chown -R mysql.mysql mysql
[root@localhost local]# ll
total 0
drwxr-xr-x. 2 root root 6 Jun 22 2021 bin
drwxr-xr-x. 2 root root 6 Jun 22 2021 etc
drwxr-xr-x. 2 root root 6 Jun 22 2021 games
drwxr-xr-x. 2 root root 6 Jun 22 2021 include
drwxr-xr-x. 2 root root 6 Jun 22 2021 lib
drwxr-xr-x. 3 root root 17 Jun 28 11:41 lib64
drwxr-xr-x. 2 root root 6 Jun 22 2021 libexec
drwxr-xr-x. 9 mysql mysql 142 Jul 31 19:32 mysql
添加环境变量
[root@localhost local]# cd mysql/bin/
[root@localhost bin]# pwd
/usr/local/mysql/bin
[root@localhost bin]# echo 'export PATH=/usr/local/mysql/bin:$PATH' > /etc/profile.d/mysql.sh
[root@localhost bin]# source /etc/profile.d/mysql.sh
[root@localhost bin]# echo $PATH
/usr/local/mysql/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
添加头文件和慢文档
[root@localhost bin]# vi /etc/ld.so.conf.d/mysql.conf
[root@localhost bin]# cat /etc/ld.so.conf.d/mysql.conf
/usr/local/mysql/lib
[root@localhost bin]# vi /etc/man_db.conf
[root@localhost bin]# cat /etc/man_db.conf | grep mysql
MANDATORY_MANPATH /usr/local/mysql/man
创建各实例数据存放的目录
[root@localhost ~]# mkdir -p /opt/data/{3306,3307,3308}
[root@localhost ~]# chown -R mysql.mysql /opt/data/
[root@localhost ~]# ll /opt/data/
total 0
drwxr-xr-x. 2 mysql mysql 6 Jul 31 19:44 3306
drwxr-xr-x. 2 mysql mysql 6 Jul 31 19:44 3307
drwxr-xr-x. 2 mysql mysql 6 Jul 31 19:44 3308
初始化
[root@localhost ~]# mysqld --initialize --datadir=/opt/data/3306 --user=mysql
2022-07-31T11:47:10.634752Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2022-07-31T11:47:10.834772Z 0 [Warning] InnoDB: New log files created, LSN=45790
2022-07-31T11:47:10.865568Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2022-07-31T11:47:10.871554Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 832d6fc0-10c6-11ed-85f6-000c29b2a6f2.
2022-07-31T11:47:10.872455Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2022-07-31T11:47:11.452398Z 0 [Warning] A deprecated TLS version TLSv1 is enabled. Please use TLSv1.2 or higher.
2022-07-31T11:47:11.452439Z 0 [Warning] A deprecated TLS version TLSv1.1 is enabled. Please use TLSv1.2 or higher.
2022-07-31T11:47:11.452863Z 0 [Warning] CA certificate ca.pem is self signed.
2022-07-31T11:47:11.727432Z 1 [Note] A temporary password is generated for root@localhost: 7GoA(tiMTaKg
[root@localhost ~]# mysqld --initialize --datadir=/opt/data/3307 --user=mysql
2022-07-31T11:47:23.629426Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2022-07-31T11:47:23.807006Z 0 [Warning] InnoDB: New log files created, LSN=45790
2022-07-31T11:47:23.834119Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2022-07-31T11:47:23.839067Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 8ae81f5c-10c6-11ed-acd3-000c29b2a6f2.
2022-07-31T11:47:23.839861Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2022-07-31T11:47:25.054152Z 0 [Warning] A deprecated TLS version TLSv1 is enabled. Please use TLSv1.2 or higher.
2022-07-31T11:47:25.054169Z 0 [Warning] A deprecated TLS version TLSv1.1 is enabled. Please use TLSv1.2 or higher.
2022-07-31T11:47:25.054594Z 0 [Warning] CA certificate ca.pem is self signed.
2022-07-31T11:47:25.250315Z 1 [Note] A temporary password is generated for root@localhost: hlgiaA0N58_r
[root@localhost ~]# mysqld --initialize --datadir=/opt/data/3308 --user=mysql
2022-07-31T11:47:31.277393Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2022-07-31T11:47:31.471598Z 0 [Warning] InnoDB: New log files created, LSN=45790
2022-07-31T11:47:31.499690Z 0 [Warning] InnoDB: Creating foreign key constraint system tables.
2022-07-31T11:47:31.555815Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 8f819ac0-10c6-11ed-a2d4-000c29b2a6f2.
2022-07-31T11:47:31.559418Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened.
2022-07-31T11:47:32.364165Z 0 [Warning] A deprecated TLS version TLSv1 is enabled. Please use TLSv1.2 or higher.
2022-07-31T11:47:32.364199Z 0 [Warning] A deprecated TLS version TLSv1.1 is enabled. Please use TLSv1.2 or higher.
2022-07-31T11:47:32.364510Z 0 [Warning] CA certificate ca.pem is self signed.
2022-07-31T11:47:32.849999Z 1 [Note] A temporary password is generated for root@localhost: OV4Wpweazg#7
安装perl
[root@localhost ~]# dnf -y install perl
配置/etc/my.cnf
[root@localhost ~]# cat /etc/my.cnf
[mysqld_multi]
mysqld = /usr/local/mysql/bin/mysqld_safe
mysqladmin = /usr/local/mysql/bin/mysqladmin
[mysqld3306]
datadir = /opt/data/3306
port = 3306
socket = /tmp/mysql3306.sock
pid-file = /opt/data/3306/mysql_3306.pid
log-error=/var/log/3306.log
[mysqld3307]
datadir = /opt/data/3307
port = 3307
socket = /tmp/mysql3307.sock
pid-file = /opt/data/3307/mysql_3307.pid
log-error=/var/log/3307.log
[mysqld3308]
datadir = /opt/data/3308
port = 3308
socket = /tmp/mysql3308.sock
pid-file = /opt/data/3308/mysql_3308.pid
log-error=/var/log/3308.log
启动
[root@localhost ~]# mysqld_multi start 3306
[root@localhost ~]# mysqld_multi start 3307
[root@localhost ~]# mysqld_multi start 3308
[root@localhost ~]# ss -anlt
State Recv-Q Send-Q Local Address:Port Peer Address:Port Process
LISTEN 0 128 0.0.0.0:22 0.0.0.0:*
LISTEN 0 80 *:3306 *:*
LISTEN 0 80 *:3307 *:*
LISTEN 0 80 *:3308 *:*
LISTEN 0 128 [::]:22 [::]:*
修改数据库密码
[root@localhost ~]# mysql -uroot -p'7GoA(tiMTaKg' -S /tmp/mysql3306.sock
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.37
Copyright (c) 2000, 2022, Oracle and/or its affiliates.
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> set password = password ('123');
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> exit
Bye
[root@localhost ~]# mysql -uroot -p'hlgiaA0N58_r' -S /tmp/mysql3307.sock
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.37
Copyright (c) 2000, 2022, Oracle and/or its affiliates.
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> set password = password ('123');
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> exit
Bye
[root@localhost ~]# mysql -uroot -p'OV4Wpweazg#7' -S /tmp/mysql3308.sock
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.37
Copyright (c) 2000, 2022, Oracle and/or its affiliates.
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> set password = password ('123');
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql>
报错解决
确少语言
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "zh_CN.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
解决
[root@localhost ~]# echo "export LC_ALL=en_US.UTF8" >> /etc/profile
[root@localhost ~]# source /etc/profile
缺少一个依赖包
mysql: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory
dnf provides libncurses.so.5
Last metadata expiration check: 0:11:51 ago on Sun 31 Jul 2022 07:55:13 PM CST.
ncurses-compat-libs-6.1-9.20180224.el8.i686 : Ncurses compatibility libraries
Repo : baseos
Matched from:
Provide : libncurses.so.5
[root@localhost ~]# dnf -y install ncurses-compat-libs