mysql相关记录

--关闭事务自动提交

set @@autocommit=0;

--执行删除,删除前最好先备份表或整个库。

--出错回滚
rollback;

--没问题提交

commit;


---
1.查看binlog
show variables like 'LOG_BIN%';

启动:
[root@localhost bin]cd /usr/bin
[root@localhost bin]./mysqld_safe &

/home/data/mysq.5.7.31/bin/ ./mysqld_safe&

--忘记密码

1.修改配置文件

[mysqld]

skip-grant-tables

  重启mysql

2.mysql -u root 登录,不需要密码,或随便输入密码都可以登录

3.use mysql

4.需要通过修改表的形式修改密码:update user set authentication_string=password('root') where user='root';

5.修改配置文件去掉skip-grant-tables

6.重启mysql

---查看数据库下每个表占用的空间,每个表的记录数

在information_schema下:

select * from tables where TABLE_SCHEMA='数据库名称' order by table_rows desc;

posted on 2022-09-13 16:28  webjlwang  阅读(18)  评论(0)    收藏  举报

导航