Thursday, September 3, 2015

MySQL : ERROR 3 (HY000): Error writing file

In one of  my development server my developers not able create a new table from Heidisql Tool.When I checked it, the server seems working fine.

Error is ,  ERROR 3 (HY000): Error writing file './backup/updateSites1.frm'

But when I checked the server disk it is almost full after I cleared the unwanted files they can able to create new table.

Issue because of Disk full so from MySQL could not create new table.



Monday, July 27, 2015

MySQL Can't create a new thread (errno 11)

In one of my MySQL Production server, I have faced an issue that MySQL could not create a new thread.Below the error i got in mysql error log file.

Error : Can't create a new thread (errno 11); if you are not
out of available memory, you can consult the manual for a possible OS-dependent bug

Solution :

1.Check your hardlimit and softlimit for MySQL user in the server.
#ulimit -a mysql

2.Change the threads in OS level,edit the below file and add the bold lines in the file.

#vi /etc/security/limits.conf


  mysql     soft     nofile     30000
  mysql     hard    nofile     30000
  mysql     soft     nproc     30000
  mysql     hard    nproc     30000



Restart MySQL

Then MySQL works fine without any error.

Its happened because of the linux server has limited connections to handle for MySQL user.After increased the value in server the error didn’t occurs.





Sunday, April 19, 2015

MySQL 5.5.30 Can't start in external HardDisk

Recently I have faced a big issue in one of my Live Production server.MySQL server could not start and throws the below error.

MySQL - 5.5.30 version
OS - Centos 6.5 - 64 bit
MySQL Data Directory in  2TB external Hard Disk


This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed,
something is definitely wrong and this may fail.
Please help us make Percona Server better by reporting any
bugs at http://bugs.percona.com/

key_buffer_size=104857600
read_buffer_size=131072
max_used_connections=0
max_threads=8002
thread_count=0
connection_count=0
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 3273305 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 0 thread_stack 0x40000




Then I have searched and found this issue because of Hardware.Becuase I have my MySQL Data directory in 2TB external HDD with ext4 file system.

So I rebooted the entire server and then started MySQL. Now it started fine with out issue.


This issue might be cause becaue of Hardware also.


Now its resolved.


Wednesday, January 21, 2015

Steps to check MySQL Slow queries with Percona Tool(Pt-Query-digit)


1.Download latest Percona tool kit.

Download from here ,

http://www.percona.com/downloads/percona-toolkit/LATEST/

2.Percona tool kit Installation steps here,

http://knowmysql.blogspot.in/2013/09/percona-tool-kit-installation.html

3.After installation enable Slow query log variable in MySQL

a.Enable through my.cnf for permanent

add below two lines,

    slow_query_log=ON
    long_query_time=5

Restart mysql

b.Enable for the current session

login to mysql server

    >set global slow_query_log=ON;
    > set global long_query_time=5;

4.By default slow query log file will be in MySQL data directory

go to mysql data directory and see hostname-slow.log

wait for few hours to get the slow queries in the log file.

5.Now run the pt-query-digit to see the slow queries

#pt-query-digest /mysqldatadirectorypath/hostname-slow.log > /backup/slowqueries.txt

6.Now evaluate the slow queries.

#less /backup/slowqueries.txt

here first in overall session you can see the total details

Second you can see the list of top queries in rankwise.

Third full details of each queries.

in the each queries the main things to see is,

Total number of execute time of the query from by 95% column.