日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > 数据库 >内容正文

数据库

mysql会话命令_mysql常用命令(持续更新)

發布時間:2025/4/16 数据库 30 豆豆
生活随笔 收集整理的這篇文章主要介紹了 mysql会话命令_mysql常用命令(持续更新) 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

show processlist;

殺死進程

kill 111111(id);

查看詳細配置信息

show variables;

查看全局狀態

show global status;

查看基本信息

\s

查看master信息

show master status\G

查看slave信息

show slave status\G

啟動/停止slave

slave start;

slave stop;

退出mysql

\q

quit;

將InnoDB的表格式轉換為MyISAM格式

ALTER TABLE `tablename` ENGINE = MYISAM

查看binlog信息

show binlog events;

用binlog恢復數據庫

mysqlbinlog --start-position=134 --stop-position=330 mysql-binlog.000001 | mysql -uroot -p

或者

mysqlbinlog --start-position=134 --stop-position=330 mysql-binlog.000001 > /root/test.txt

進入MYSQL導入

mysql> source /root/test.txt

binlog恢復部分數據庫

mysqlbinlog -d test --start-position=134 --stop-position=330 mysql-binlog.000001 | mysql -uroot -p test

或者

mysqlbinlog -d test mysql-binlog.000001 > /root/test.txt

進入MYSQL導入

mysql> source /root/test.txt

查看binlog文件

show binary logs;

結果:

Log_nameFile_size

mysql-bin.000097188508046

mysql-bin.00009821117

mysql-bin.0000991041262

mysql-bin.0001001073840875

mysql-bin.0001011073746745

mysql-bin.000102505666779

mysql-bin.0001031073742195

mysql-bin.00010427878070

mysql-bin.000105866926714

mysql-bin.0001061073860943

mysql-bin.000107246717786

mysql-bin.000108117

mysql-bin.0001094863847

刪除bin-log

(刪除mysql-bin.000100之前的所有二進制日志文件,不包括mysql-bin.000100)

purge binary logs to 'mysql-bin.000100';

show binary logs;結果:

Log_nameFile_size

mysql-bin.0001001073840875

mysql-bin.0001011073746745

mysql-bin.000102505666779

mysql-bin.0001031073742195

mysql-bin.00010427878070

mysql-bin.000105866926714

mysql-bin.0001061073860943

mysql-bin.000107246717786

mysql-bin.000108117

mysql-bin.0001094863847

修改運行中mysql的參數

(不加 GLOBAL 只對當前會話有效)

SET GLOBAL wait_timeout = 600;

myisam引擎查看post表信息

myisamchk -dv post

修改密碼

mysql -u root

use mysql

UPDATE user SET password=PASSWORD("new password") WHERE user='name';

FLUSH PRIVILEGES;

查詢結果輸出到文件

pager cat > /tmp/temp.txt

select * from table1 limit 100;

分享到:

2009-10-06 01:53

瀏覽 1528

論壇回復 / 瀏覽 (1 / 4216)

分類:數據庫

評論

1 樓

wangpeihu

2010-09-05

文章不錯,如果加上適當的說明,就更好了。學習中...

總結

以上是生活随笔為你收集整理的mysql会话命令_mysql常用命令(持续更新)的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。