WHAT'S NEW?
Loading...
Showing posts with label problem. Show all posts
Showing posts with label problem. Show all posts
This morning one of my sites using Wordpress and MySQL stopped working indicating an error in the connection to the database. Trying to connect with the client mysqlyog I obtained the following error message.


ERROR 1820 (HY000): Your password has expired. To log in you must change it using a client that supports expired passwords.

The problem is because mysql 5.7.4 or later will expire all user password after 360 days by default!!

How to solve this problem? Login by command line client and setup a new password

C:\wamp\bin\mysql\mysql5.7.9\bin>mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 13
Server version: 5.7.9

Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> SET PASSWORD = PASSWORD('newpassword');
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> ALTER USER 'root'@'localhost' PASSWORD EXPIRE NEVER;
Query OK, 0 rows affected (0.00 sec)

mysql> show global variables like 'default_password_lifetime';
+---------------------------+-------+
| Variable_name             | Value |
+---------------------------+-------+
| default_password_lifetime | 360   |
+---------------------------+-------+
1 row in set (0.00 sec)

You have to modify the value of this variable in order to avoid the problem again after 360 days.

mysql> set global default_password_lifetime=0;

Query OK, 0 rows affected (0.00 sec)



If your Windows 10 PC randomly turn on for whatever reason you must follow these instructions. 


Right click your start button and select Command prompt (Admin) 
Type :

powercfg.exe -lastwake 
press enter and see what it says it may tell you what is waking it up. 
powercfg.exe -waketimers
may also give you an idea of what's allowed to wake it.

You can also try entering 
control powercfg.cpl,,1 
in the command prompt to access the advanced power properties. Scroll down to the "sleep" section, press the +, do the same with the "wake timers" section and then select "disable" or "important timers only".

If that doesn't do:

  • Go to Device Manager -> Mouse & Input Devices -> Mouse -> Right Click -> Properties -> Power Mgmt tab -> Uncheck the box
  • On "power options" (type power options in the start menu, its the one with the battery and cable icon), change plan settings, change advanced power settings, in the "sleep" item disable "wake timers"
I was using a VPS on SSD server with 2 GB RAM with Apache and Tomcat. Tomcat stops working without any logs, it doesn't hang, it just shut down after some hours or minutes.

The problem is that the JVM is crashing. The JVM crash log typically has a name like hs_err_pid*.log and is created in the JVM's working directory.

In case of OpenJDK the crash logs could look like /tmp/jvm-*/hs_error.log

#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (malloc) failed to allocate 134217728 bytes for AllocateHeap
# Possible reasons:
#   The system is out of physical RAM or swap space
#   In 32 bit mode, the process size limit was hit
# Possible solutions:
#   Reduce memory load on the system
#   Increase physical memory or swap space
#   Check if swap backing store is full
#   Use 64 bit Java on a 64 bit OS
#   Decrease Java heap size (-Xmx/-Xms)
#   Decrease number of Java threads
#   Decrease Java thread stack sizes (-Xss)
#   Set larger code cache with -XX:ReservedCodeCacheSize=
# This output file may be truncated or incomplete.
#
#  Out of Memory Error (allocation.inline.hpp:64), pid=20123, tid=139649106921216
#
# JRE version:  (7.0_111-b01) (build )
# Java VM: OpenJDK 64-Bit Server VM (24.111-b01 mixed mode linux-amd64 compressed oops)
# Derivative: IcedTea 2.6.7
# Distribution: CentOS Linux release 7.2.1511 (Core) , package rhel-2.6.7.2.el7_2-x86_64 u111-b01
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#

........................

---------------  S Y S T E M  ---------------

OS:CentOS Linux release 7.2.1511 (Core)

uname:Linux 4.5.5-x86_64 #3 SMP Fri May 20 15:25:13 EDT 2016 x86_64
libc:glibc 2.17 NPTL 2.17
rlimit: STACK 8192k, CORE 0k, NPROC 7982, NOFILE 4096, AS infinity
load average:0.01 0.07 0.08

/proc/meminfo:
MemTotal:        2047352 kB
MemFree:           25084 kB
MemAvailable:     100388 kB

[root@myvps /]# free -m
             total        used        free      shared  buff/cache   available
Mem:           1999        1888          20           2          90          44

Swap:           255         255           0
The problem is that there is not enough ram memory. The only solution is to add more RAM for a total of 4GB. My VPS needed an update!