List:MySQL on Win32« Previous MessageNext Message »
From:Surya Date:November 15 2013 4:09am
Subject:Re: Fwd: MySQL database do not start
View as plain text  
Hello Dr.Massimo,

Please answer the following questions and please be patient. I do not
want to be the the reason for data loss and is the reason why I am
asking these questions to understand the situation better.

Second- I am an aspiring DBA in Mysql , which is the reason why I am
trying to solve problems in the forum to make my self stronger. I may
make errors and I am trying not to.

Third- I am an Electrical Engineer and have been inventing and working
with my own MySQL DB solutions at my workplace ( read workplace
automation) for the past 2 years. So far I did not face major or minor
problems.

I am also re-posting this entire email to the forums so that someone
can correct me in case I tripped or forgot something important.

[1] Usually the Database is different from the application unless it
is embedded. As I understand from your error messages, your
application is connecting to the database using Java.

Normally, You should be able to upgrade the database independently
from the application as long as the application supports the database.

[2] I think your application only supports the older versions of the
database. The latest version of MySQL is 5.x. Can you not upgrade to
the latest database version without application incompatibility
issues.? Do you still have support option for the front end PCDM
application? In case it is available it is safe to ask them to help
you out. In case that is not an option, please move on.

[3] Is there a backup option of the database from the software
interface.? i.e., Does PCDM software provide for a backup option.? If
it exists, then try it out and proceed further. Does such an option
ever exist or what is mentioned in the user manual of the software on
the issue of how to backup your valuable data, when needed.? Please
check.

[a] Next how is the software installed. ? Is it that MySQL is
installed and then the PCDM software is installed ? or is it that PCDM
software did the entire installation including configuring the DATA
directories.?

I am not sure whether you can remember them. But I want to be doubly
sure that you do back them up properly.

In your case it appears that the application installed MYSQL and/ or
has configured its data directory to the one shown in your power point
slides. It appears that it is the one to be backed up.

However open the command (DOS) prompt and issue the following command
to find the Data directory.

======= MY OUTPUT FROM THE COMMAND LINE ================

[C:\]mysql -u root -p
Enter password: *****************
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 58
Server version: 5.6.14-log MySQL Community Server (GPL)

mysql> show variables where variable_name like "%dir%";
+-----------------------------------------+---------------------------------------------------------+
| Variable_name                           | Value                                         
         |
+-----------------------------------------+---------------------------------------------------------+
| basedir                                 | C:\Program Files\MySQL\MySQL Server 5.6\      
         |
| binlog_direct_non_transactional_updates | OFF                                           
         |
| character_sets_dir                      | C:\Program Files\MySQL\MySQL Server
5.6\share\charsets\ |
| datadir                                 | C:\ProgramData\MySQL\MySQL Server 5.6\data\   
         |
| ignore_db_dirs                          |                                               
         |
| innodb_data_home_dir                    |                                               
         |
| innodb_log_group_home_dir               | .\                                            
         |
| innodb_max_dirty_pages_pct              | 75                                            
         |
| innodb_max_dirty_pages_pct_lwm          | 0                                             
         |
| innodb_undo_directory                   | .                                             
         |
| lc_messages_dir                         | C:\Program Files\MySQL\MySQL Server 5.6\share\
         |
| plugin_dir                              | C:\Program Files\MySQL\MySQL Server
5.6\lib\plugin\     |
| slave_load_tmpdir                       |
C:\Windows\SERVIC~2\NETWOR~1\AppData\Local\Temp         |
| tmpdir                                  |
C:\Windows\SERVIC~2\NETWOR~1\AppData\Local\Temp         |
+-----------------------------------------+---------------------------------------------------------+
14 rows in set (0.00 sec)

====================================================================

So check the above and get assured that the "datadir" to be backed up
is the one you have installed in your system, as already shown in your
powerpoint and which is attached along with this reply.

[4] I have done the following a few weeks back when I did not have a
backup of my DB, and when I was forced to re-install my machine due to
a Hard disk upgrade from spinning disk to an SSD. I did not have a
choice. And it worked. So I think it will work for you as well

First:

[5] Are there any changes that are done to the Machine recently? like
installing a new software or doing windows update which triggered all
of these issues ? If you suspect any application is causing the
problem, then try uninstalling it to try to resolve the problem.

[6] There are two ways to do backup of the database.

[a] Since the service is not starting, you cannot use "mysqldump"
command to backup- Hence the only way is to save the data files
directory and restore them as follows. This is called Binary DB backup
method.

This is done using the Windows explorer or other standard windows
tools or even from the command prompt if you are well versed working
with command line tools.

[b] You must copy all files that are required to restore the tables
that you’re backing up. Direct-copy methods are easiest to use for
storage engines such as MyISAM that represent a given table using a
unique set of files in the database directory.

To back up a MyISAM table, you need to copy only its .frm, .MYD, and
.MYI files.

For a storage engine such as InnoDB, it’s more complicated: You must
copy the .frm files, plus all the tablespace files and the InnoDB log
files.

A complete binary backup includes all files in which table contents
are stored and any log files that are used by specific storage
engines. For good measure, you should also copy the binary log files.

All of your database directories are under the data directory, and
logs and information files are created there by default as well.

[7] So copy the entire PCDM directory for safety sake using windows
explorer.

Now that you have copied the entire DATA directory containing the DB
table files etc., into a safe place like a pendrive or a CDROM, you
should be able to reinstall the application once again.

[8] The process of re-installation of the software consists of the
following steps:

Depending on your answers to Question 3[b] in the above email, you
have two choices:

[a] Install the DB and the application separately.
[b] Just Install the Application and it will do the rest.

BEFORE proceeding in either of the above routes, do the following:
=================

The step below is to correct any file system errors that have arisen
in the installation Partition over time:

[9] Do a CHKDSK <drive name>:/f to check the drive on which the
database is installed for any file system errors.

Ex: in command prompt type the following in case the database is
installed on the 'C' drive.

$ CHKDSK c:/f

the "f" option after the drive letter in the above command is for
correcting the errors in the file system.

If it is C drive then you will be prompted to do a reboot after which,
the drive is checked for errors and fixed. If CHKDSK is taking a long
time or is stuck, there is a more serious error on the Hard disk
sectors.

Then you will have to use "SpinRite" software from www.grc.com to try
to fix your Hard drive defective sector(s) and retrieve data ( most of
the time SpinRite is very very successful).

=================

STOP HERE AND REVIEW.

So far you have done disk checks, did a manual DIRECTORY( or FOLDER)
copy of the DATA directories and are ready to proceed further.

The Next step involves uninstalling the application and / or the
Database and re-nistalling them and then rechecking whether everything
is working fine.

~~~~~~~~~~

[10] Do you have Disk Imaging software like Acronis Disk Image or
Terabyte unlimited Image for DOS software licensed with you. In case
you do have it, Image the entire drive which has your software
installed and have a backup copy .

[11] If you do not have disk imaging software licensed then - do you
have a duplicate test machine on which you can install your software
and restore your database backup.

Steps 10, 11 exist to be sure that we do not lose any data.

If you are successful in steps 10 or 11 above then proceed as below.

[12]

For 8[a] - First uninstall the MYSQL database using "Add/Remove
programs " in control panel applet and if it asks you to " shall I
keep the data directories" - say Yes and just un-install the
application. Usually the DATA directories are not removed.

Then re-install the Database and re-install the application. By
looking at your DATA directory, it appears that the DATA directory is
not the standard directory that Mysql uses while installing and has
been altered.

Refer to Reference [2] below on how to change your datadir manually by
editing a config file.

For 8[b] - re-install the PCDM software which will do the rest after
un-installing it.


[13] Finally I have tried to enumerate as many scenarios as possible
to be sure that you will not lose valuable data. Please revert if you
have any doubts in any one of the above or are not confident to
proceed further.

Then it might be better to consult your local IT department .

useful references:
[1] 

http://dev.mysql.com/doc/refman/5.0/en/innodb-backup.html

--reproduced from the above website in verbatim-- this is very
important to understand ---

In addition to making binary backups as just described, you should
also regularly make dumps of your tables with mysqldump. The reason
for this is that a binary file might be corrupted without you noticing
it. Dumped tables are stored into text files that are human-readable,
so spotting table corruption becomes easier. Also, because the format
is simpler, the chance for serious data corruption is smaller.

---

[2] 

how to change the datadir.

see http://stackoverflow.com/questions/1795176/how-to-change-mysql-data-directory

-- 
Regards,
Surya@iNDIA


Wednesday, November 13, 2013, 10:46:35 PM, you wrote:

> Dear Surya,
> thank you very much for your kind assistence. I do hope your Dad is going better
> right now. 
> Enclosed there is a ppt presentation in which I summarized the step I would do to
> save the data.
>  could  you please let me know if it is correct?
> thank you very much
> Massimo





> 2013/11/12 Surya <surya@stripped>

>  Hello Dr.Massimo,
>  Please  see  the  attached PDF file which is an extract from one of my
>  books on DB maintenance.
>  Please refer to the section on Binary backups - 14.4.2 and try to read
>  and understand.
>  If  you  can  follow up the instructions and could backup the DB, then
>  you are safe to go.
>  In  case  you are not confident about the whole process, tell me where
>  you are not ok and I will start from there.
>  Proceed  with caution. I am stuck in the hospital and hence the reason
>  why I could not give you step by step instructions.
>  
>  Monday, November 11, 2013, 3:22:37 PM, you wrote:
>  
 >> Dear Surya,
>  
>  
 >> I did not receive any feedback to the mail sent the last november 8th.
 >> I forwarded it to you in case you did not receive it.
>  
>  
 >>  Please Let me know how to proceed.
>  
>  
 >> best regards
>  
>  
 >> Massimo 
>  
>  
 >> ---------- Forwarded message ----------
 >> From: Massimo Papale <massimo.papale@stripped>
 >>  Date: 2013/11/8
 >> Subject: Re: MySQL database do not start
 >> To: Surya <surya@stripped>
 >> Cc: win32@stripped
>  
>  

 >> Dear Surya,
>  
>  
 >> I replay to your questions afterwards:
>  
>  
 >> [1] Please include it if possible as an inline reply to your email.
>  
>  
 >> The files which explain the error type are attached to the present email. 
>  
>  
 >> [2] Did  you  try  to  go  to  service  applet in control panel and try to
 >>   restart the service?
>  
>  
 >> Yes I tried but when I try to restar the service the message
 >> reported in the attached file 2 appears.

 >> [3] Next  if  it  is still giving an error, try -reinstalling the software
 >>   without un-installing it, reboot and retry.
>  
>  
 >> I tried reinstalling the software but the problem persist. 
>  
 >> [4] what is the IP address used by your front end to connect to Mysql.
 >>   In  case  it  is  the  same  machine,  then  it  should be localhost (
>  
 >> 127.0.0.1) and the standard port.
>  
>  
 >> The IP address of that computer connected to the machine is that
 >> you reported in your message. That is the localhost. 
>  
>  
>  
>  
 >> Waiting for hearing about you, 
>  
>  
 >> Best regards
>  
>  
 >> Massimo
>  
>  
>  
>  
>  
 >> 2013/11/8 Surya <surya@stripped>

 >> Hai,

 >>  Actually  no  attached  file  exists  in  your  file  to see the error
 >>  message.

 >>  [1] Please include it if possible as an inline reply to your email.

 >>  [2] Did  you  try  to  go  to  service  applet in control panel and try to
 >>  restart the service?

 >>  [3] Next  if  it  is still giving an error, try -reinstalling the software
 >>  without un-installing it, reboot and retry.
 >>  [4] what is the IP address used by your front end to connect to Mysql.
 >>  In  case  it  is  the  same  machine,  then  it  should be localhost (
 >>  127.0.0.1) and the standard port.

 >>  Check the above steps and let us know whether it solved the problem.

 >>  --
 >>  Best regards,
 >>  Surya@india                            mailto:surya@stripped


 >>  Thursday, November 7, 2013, 5:56:11 PM, you wrote:

  >>>             Dear Sirs,



  >>> I have a problem accessing MySQL database. Precisely, I am working with
  >>> proteinChip data Manager software (Biorad) and when I try to login the
  >>> software, the access is denied and the message reported in the attached
  >>> file 1 appears.

  >>> I could recognize that MySQL do not start and when trying to start it
  >>> manually, the message reported in the attached file n.2 appears.


  >>> Please let me know how I can solve the problem or how I can save my data
  >>> before trying to uninstall and re-install the software and the database


  >>> How-To-Repeat:

  >>>             <code/input/activities to reproduce the problem (multiple
 >>  lines)>>

  >>> Fix:

  >>>             <how to correct or work around the problem, if known
(multiple
 >>  lines)>>



  >>> Synopsis:         <MYSQL database do not start

  >>> Submitter-Id:    <submitter ID>

  >>> Originator:        <Massimo Papale>

  >>> Organization:   <University of Foggia>

  >>> MySQL support:  [none | licence | email support | extended email support ]

  >>> Severity:           [serious]

  >>> Priority:            [high ]

  >>> Category:         [mysqld, mysql client, C, PHP, PERL,  ...]

  >>> Class:               [ sw-bug | doc-bug | change-request | support ]

  >>> Release:           mysql-3.23.38



  >>> Exectutable:   [mysqld, mysqld-shareware, mysqld-nt or mysqld-opt]

  >>> Environment:   <Pentioum R dual-core CPU 2.8 GHz , 3.25 GB Ram>

  >>> System:        <Windows XP professional >

  >>> Compiler:      VC++ 6.0

  >>> Architecture:  i

 >> --
>  
 >> Massimo Papale, PhD
 >> Dept of Surgery and Medical Sciences
 >> University of Foggia
 >> Via L. Pinto n. 1 71122 Foggia Italy
 >>   tel +39 0881 587105
 >> fax +39 0881 587123
 >> e-mail: m.papale@stripped
 >>            mpapale78@stripped 
>  
>  
>  
>  

Thread
Re: Fwd: MySQL database do not startSurya15 Nov