MySQL
MySQL
1、介绍
2、隔离级别
--
mysql>select @@tx_isolation ;
-- 当前会话
mysql>select @@session.tx_isolation ;
-- 查询全局
mysql>select @@global.tx_isolation ;
-- 设置隔离级别,必须在事务启动前设置
mysql>set transaction isolation level read uncommitted ;
mysql>set transaction isolation level read committed ;
mysql>set transaction isolation level repeatable read ;
mysql>set transaction isolation level serializable ;
-- 关闭自动提交,0|off
mysql>set autocommit=0 ;
-- 启动自定提交,1 | on
mysql>set autocommit=off ;
-- 开启事务
mysql>start transaction ;
3、Mysql完全卸载
-
控制面板卸载mysql
-
删除mysql安装目录
-
删除C:\ProgramData\MySQL数据文件夹
-
删除注册表
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\Eventlog\Application\MySQL
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\Services\Eventlog\Application\MySQL
4、mysql远程root连接拒绝
-
修改授权
mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION;
-
清理授权
mysql>FLUSH PRIVILEGES;
-
显式授权
mysql>SHOW GRANTS FOR 'Max'@'localhost'; mysql>show grants ; -- 撤销授权 mysql>revoke all on *.* from dba@localhost;
5、忘记root密码
-
停止mysql服务器
-
linux
$>sudo kill -9 <pid>
-
windows
控制面板中停止。
-
-
启动服务时,跳过授权表
-
linux
$>mysqld_safe --skip-grant-tables &
-
windows
cmd>mysqld.exe --skip-grant-tables
-
-
修改密码
-
无验证登录
cmd>mysql.exe -uroot
-
修改系统用户表
mysql>update mysql.user set password=password('root') where user='root' ; mysql>flush privileges ; mysql>exit ;
-
-
重启mysql
6、设置mysql执行时间精度
mysql>set profiling=1 ;
mysql>select count(1) from t ;
mysql>show profiles ;