daily_issues
                Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| daily_issues [2011/04/14 01:44] – k2patel | daily_issues [2020/08/10 02:35] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 14: | Line 14: | ||
| </ | </ | ||
| + | ===== Mysql Generate hash for password ===== | ||
| + | <code mysql> | ||
| + | SELECT PASSWORD(' | ||
| + | </ | ||
| + | OR | ||
| + | |||
| + | <code mysql> | ||
| + | SELECT OLD_PASSWORD(' | ||
| + | </ | ||
| ==== MySQL Cluster information gathering ==== | ==== MySQL Cluster information gathering ==== | ||
| Line 78: | Line 87: | ||
| Following method shows how to enable it in table without restarting, | Following method shows how to enable it in table without restarting, | ||
| Also same you can apply in my.cnf\\ | Also same you can apply in my.cnf\\ | ||
| + | |||
| + | Structure usually created with mysql installation if you don't see could be old structure.\\ | ||
| + | try running // | ||
| <code sql | Table Structure> | <code sql | Table Structure> | ||
| Line 95: | Line 107: | ||
| log_output=TABLE, | log_output=TABLE, | ||
| </ | </ | ||
| + | |||
| + | Following command can help you apply changes without restart. | ||
| <code sql | Command > | <code sql | Command > | ||
| SET GLOBAL log_output=' | SET GLOBAL log_output=' | ||
| SET GLOBAL general_log=' | SET GLOBAL general_log=' | ||
| + | </ | ||
| + | |||
| + | How to flush log. | ||
| + | |||
| + | <code sql | Flush log> | ||
| + | mysql -u root -pp4ssw0rd -e " | ||
| + | </ | ||
| + | |||
| + | ==== mysql dump only partition information ==== | ||
| + | If you were planning to drop a partition, you may need to back it up. find out the range of the partition by | ||
| + | |||
| + | < | ||
| + | show create table tablename | ||
| + | </ | ||
| + | |||
| + | replace the range fields as follows: | ||
| + | < | ||
| + | mysqldump -S --no-create-info --where=" | ||
| + | </ | ||
| + | |||
| + | ==== Reading Binlog ==== | ||
| + | |||
| + | Simple command to read binlog is | ||
| + | <code bash> | ||
| + | mysqlbinlog mysql-bin.000013 | ||
| + | </ | ||
| + | |||
| + | You can use following regularly used options. | ||
| + | <code bash> | ||
| + | --start-datetime= | ||
| + | --start-position= | ||
| + | --server-id= | ||
| + | </ | ||
| + | |||
| + | ==== Can't open file ==== | ||
| + | |||
| + | I've started seeing following error in my log.\\ | ||
| + | |||
| + | <code text> | ||
| + | [ERROR] / | ||
| + | </ | ||
| + | |||
| + | It is caused by file discriptor limit set by the system.\\ | ||
| + | You can check that by changing your shell to mysql user and running following command. | ||
| + | |||
| + | <code bash> | ||
| + | ulimit -a | ||
| + | </ | ||
| + | |||
| + | In order to increase the open file limit.\\ | ||
| + | edit following file.\\ | ||
| + | |||
| + | <code bash / | ||
| + | mysql  soft  nofile | ||
| + | mysql  hard  nofile | ||
| + | </ | ||
| + | |||
| + | Now you can check mysql for limit seen by mysql.\\ | ||
| + | login to mysql as root and run following command.\\ | ||
| + | |||
| + | <code mysql> | ||
| + | show GLOBAL VARIABLES LIKE " | ||
| + | </ | ||
| + | |||
| + | Now you can modify it to increased limit in limits.conf.\\ | ||
| + | by editing following file. | ||
| + | |||
| + | <code bash / | ||
| + | [mysqld] | ||
| + | open-files-limit=49152 | ||
| + | |||
| + | [mysqld_safe] | ||
| + | open-files-limit=49152 | ||
| + | </ | ||
| + | |||
| + | restart mysql and check again it should represent new value. | ||
| + | |||
| + | ==== InnoDB: Unable to lock ./ibdata1, error: 11 ==== | ||
| + | |||
| + | I've stumble across this issue while running mariadb server in VM Guest.\\ | ||
| + | I believe this happens sometime when VDP is doing backup or machine is being migrated by DRS. | ||
| + | |||
| + | In my case, i've enable innodb per tables. So i've to clear lock from all files in subfolder.\\ | ||
| + | In order to fix the issue, following command usually fix the issue. | ||
| + | <code bash> | ||
| + | systemctl stop mariadb | ||
| + | cd / | ||
| + | for i in `find . -name ' | ||
| + | systemctl start mariadb | ||
| </ | </ | ||
daily_issues.1302745442.txt.gz · Last modified: 2020/08/10 02:30 (external edit)
                
                