对于performance_schema库show events时报 1044
网友遇到这个问题: 对于performance_schema库show events时报 1044 mysql> use performance_schema; 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 events;&...
mysql释放文件高水位
释放文件高水位: 试试 delete 和 truncate是否会释放文件高水位 mysql> select version();+-------------------------------------------+| version() |+----------------------...
Using index condition Using index
Using index conditionTables are read by accessing index tuples and testing them first to determine whether to read full tablerows. In this way, index information is used to defer (“push down”) reading full table rows unless it isnecessary.通过索引访问表,看是否需要全表扫描,这时...
区分socket连接和tcp/ip连接
mysql连接时,如果使用了localhost,那么使用的是 socket连接。 感觉不应该是这个样子。今天测试:所以,并不是朋友说的那个样子。mysql@localhost ~]$ mysql -u sla -p -h 127.0.0.1 Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL co...
mysql trace optimizer
mysql> show variables like '%trace%';+------------------------------+----------------------------------------------------------------------------+| Variable_name | Value &n...
innodb_data_file_path初始化太大引起的错误
朋友升级了库,但是启库的时候 却报错了,根据他的报错猜想应该是innodb_data_file_path的问题,就把自己库的innodb_data_file_path初始化大小加大,报错如下,重现了朋友的错误2015-04-24 19:37:51 3628 [ERROR] InnoDB: auto-extending data file ./ibdata1 is of a different size 4864 pages (rounded down t...
mysql_fix_privilege_tables 和mysql_upgrade
mysql_fix_privilege_tables 和mysql_upgrade今天朋友提到这个工具, 并且说这个是在升级的时候用到,升级权限表。我在5.6的文档中却没有找到这个在shell下, 也没有找到这个这是个什么东西啊,bing了一下,是有介绍这个东西,可是我这里却没有 。他的作用应该是和 mysql_...
mysql additional pool 指的是什么?
刚开始认为additional pool指的是 innodb_additional_mem_pool_size。但是看到下面的情况,让我有点 疑惑:mysql> show variables like '%additional%';+---------------------------------+---------+| Variable_name | Value ...
flush logs时做的操作
flush logs时做的操作: 对于一般查询日志和慢日志,先关闭文件再打开 对于binlog,关闭当前的,开始用下一个新的 用错误日志文件的话,先关闭再打开flush logs可以对一般查询日志,慢日志,错误日志 进行改名备份后重新生成文件(还是原来的名字) ...
INNODB监控开关
INNODB监控开关: 标准监控: 打开标准的innodb监控 CREATE TABLE innodb_monitor (a INT) ENGINE=INNODB; 关闭标准的innodb监控 DROP TABLE innodb_monitor; 通过建表的方式会有一个告警信息: mysql> CREATE TABLE innodb_moni...
奇怪的现象
这样的你们见过过吗? why?mysql> show slave status\G;*************************** 1. row *************************** Slave_IO_State: Waiting for master to send event Master_Host: XXX...
shell中使用sudo不输入密码
shell中使用sudo不输入密码[mysql@localhost ~]$ cat aa.sh #!/bin/bash echo "password" | sudo -S cat /var/log/messages
mysql关闭过程
mysql关闭过程:1 开始关闭如果是客户端关闭的会,会建立一个shutdown的线程,如果是收到一个SIGTERM信号,那么他本身就是shutdown线程,也有可能创建一个。如果创建线程不能成功(例如,内存不足),会写一个错误日志Error: Can't create thread to kill server2 不再接受新的连接。3 中止当前的活动连...
使用skip-grant-tables启动库后不能执行grant语句
使用skip-grant-tables选项启动数据库时,不能执行 grant语句,可以对mysql.user表进行,update,delete,insert操作:[mysql@localhost ~]$ mysqld_safe --skip-grant-tables [mysql@localhost ~]$ mysql Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL conne...
sql mode 和用户自定义分区
SQL mode and user-defined partitioning. Changing the server SQL modeafter creating and inserting data into partitioned tables can cause major changesin the behavior of such tables, and could lead to loss or corruption of data. It isstrongly recommended that you never change the SQL mo...
主从环境中,从IO进程被停掉
主从环境中 ,如果主中的binlog已经被从读到中继日志,但是还没有被sql应用,这时从库上的从IO进程停掉了,sql进程仍然会把已经读到中继日志中的内容应用:也就是说这两个是独立的。例:在从库上 mysql> stop slave SQL_THREAD;Query OK, 0 rows affected (0.00 sec)...
Slave failed to initialize relay log info structure from the repository
启动从时报错:mysql> start slave;ERROR 1872 (HY000): Slave failed to initialize relay log info structure from the repositoryreset slave之后可以:mysql> reset slave;Query OK, 0 rows affected (0.00 sec)mysql> change master to master_host='192.168.118.161', master_user...
binlog_format=row显示语句
binlog_format=row的情况下: 对delete的内容,通过 mysqlbinlog找到 真实的delete语句, 也可以通过这种方法 ,构成一个insert语句,然后回滚这个操作 binlog_format=statement是不行的。 例: mysql> show variables like '%binlog_format%' -> ; +---------------+-------+ ...
mysql设置变量时何时可以使用表达示,何时可以使用M,G等单位
在操作符命令下不能使用 运算表达式,可以使用 M,G等单位。 在mysql命令行中,可以使用 运算表达式, 不可以使用M,G等单位。 例: 在OS命令下:[mysql@localhost mysql]$ mysql --max-allowed-packet=16M -u root -p123456 Warning: Using a password on the command line interface can be ins...
Mysql执行批量sql时的格式问题
Mysql执行批量sql时的格式问题:mysql执行批量sql时,输出格式想和在mysql提示符下一致的话,使用-t 选项-t, --table Output in table format.例:没有使用-t的样式:[mysql@localhost tmp]$ mysql -u root -p < /home/mysql/select_tt.txt | less Enter...