borgkun
12/7/2018 - 7:28 AM

mysql

mysql

Reset password

sudo /etc/init.d/mysql stop
sudo mysqld --skip-grant-tables &
mysql -u root mysql
UPDATE mysql.user SET Password=PASSWORD('YOURNEWPASSWORD') WHERE User='root';
FLUSH PRIVILEGES;
exit;   
sudo /etc/init.d/mysql start 

Slow log

log_slow_queries        = /var/log/mysql/mysql-slow.log
long_query_time         = 1

SET GLOBAL slow_query_log = 'ON';
SET GLOBAL long_query_time = 1;
SET GLOBAL slow_query_log_file = '/var/log/mysql/mysql-slow.log';