摘要: ## 二进制安装 1、删除centos系统自带的mariadb数据库 ```shell [root@localhost local]# rpm -qa |grep mariadb mariadb-libs-5.5.68-1.el7.x86_64 [root@localhost local]# rpm 阅读全文
posted @ 2022-03-29 11:39 闲着没事学学习 阅读(63) 评论(0) 推荐(0) 编辑
摘要: 数据库主从配置 对主数据库锁表并备份 主库需要开启binlog日志 更改从库/etc/my.cnf中[mysqld]模块中的#log_bin=PATH(binlog日志存储的位置) 锁表: root@leadchina 09:13:18->flush table with read lock; 查看 阅读全文
posted @ 2022-03-12 18:54 闲着没事学学习 阅读(143) 评论(0) 推荐(0) 编辑
摘要: windows共享挂在方法 mount -t cifs -o username=administrator,password=**,gid=,uid= //172.32.2.43/d$ /mnt/cdrom/ 查询gid和uid的方法是 ip username 开机自动挂载 vim /etc/fst 阅读全文
posted @ 2022-03-07 18:50 闲着没事学学习 阅读(32) 评论(0) 推荐(0) 编辑
摘要: mysqldump -uusername -p datebase >备份文件名.sql 备份语句: mysqldump -uroot -p -B test >/opt/test_bak.sql 恢复备份 mysql -uroot -p </opt/test_bak.sql mysqldump备份是m 阅读全文
posted @ 2022-02-26 16:26 闲着没事学学习 阅读(34) 评论(0) 推荐(0) 编辑
摘要: 背景: 我们在手动更新数据时候没有添加条件就会把整列直接更新上去,这样会会导致该列数据出错; 更新前: root@leadchina 03:32:13->select * from student; + + + + + | id | name | age | dept | + + + + + | 1 阅读全文
posted @ 2022-02-24 15:41 闲着没事学学习 阅读(36) 评论(0) 推荐(0) 编辑
摘要: vi /etc/my.cnf 在#log_bin=mysql_bin后添加下面三行数据 server-id =1 log-bin=master (注:此步操作为开启binlog) binlog_format=row 阅读全文
posted @ 2022-02-23 20:04 闲着没事学学习 阅读(57) 评论(0) 推荐(0) 编辑
摘要: 命令语法:update table_name set 字段=new_values .... where (注意:添加条件) 例如:更新前 root@leadchina 07:07:03->select * from student; + + + + + | id | name | age | dep 阅读全文
posted @ 2022-02-23 19:34 闲着没事学学习 阅读(79) 评论(0) 推荐(0) 编辑
摘要: 可以查看是不是能优化查询 explain select * from student where dept='shuxue' \G; *************************** 1. row *************************** id: 1 select_type: S 阅读全文
posted @ 2022-02-23 19:02 闲着没事学学习 阅读(43) 评论(0) 推荐(0) 编辑
摘要: 在我们插入数据中有中文的时候会报错如下: root@leadchina 07:43:32->INSERT INTO student VALUES(0001,'宏志','男',30,'计算机网络'); ERROR 1366 (HY000): Incorrect string value: '\xE5\ 阅读全文
posted @ 2022-02-22 20:56 闲着没事学学习 阅读(525) 评论(0) 推荐(0) 编辑
摘要: 1、查看当前的防火墙状态 systemctl status firewalld2、临时手动关闭防火墙systemctl stop firewalld3、手动重启防火墙systemclt restart firewalld4、永久关闭防火墙systemctl disable firewalld5、关闭 阅读全文
posted @ 2022-02-22 17:00 闲着没事学学习 阅读(281) 评论(0) 推荐(0) 编辑
点击右上角即可分享
微信分享提示