Wednesday, April 29, 2009

MySQL Database Server Starting & Showndowning

Hi Guys,

I am finguring my hands on mysql opensource database. When I want to refresh my db skills, I like hsql db really fasinated with opensource footprint database. Other best thing is if jvm is installed in your system with single jar file, you can start db with no time. So when u want to work with small applications when want to work on poc, it is very usefull.

The idea of this blog is a self reference for me. I knew that I am not able to cover seam blog I start started recently which i will start posting stuff interesting to J2EE Users.

Good things about Java and Java based applications is that there no installation. If I have multiple os or using Virtual Guest Operating systems, it helps me to use the same again and again with out installation.

One point that comes to my mind is that Eclipse, Netbeans, JDeveloper Sql Developer from oracle really good tools that need to use if you are a java/j2ee developer. The bigest advantage is that there is not installation to work with and I can start my IDE and start my app server and deploy my application.


good news to java developers is that google has started app engine support with Java /J2EE delopment. So for freshers, if you want to master in one framework and deploy your application and take the advantage of environment, it really helps you a lot.

People who are interested in developing webapplication in java/ phython you can touch with me @ javavasu@gmail.com





Lets start with mysql server. As per the reference I am using current stable version. As I mentioned I am using non- installable version.


mysql-noinstall-5.1.34-win32.zip.





Unzip the version and data is copied to mysql-5.1.34-win32.





Considering E:\mysql-5.1.34-win32, lets start with the suff.





First question that comes to mind is how to start with mysql server
"E:\mysql-5.1.34-win32\bin\mysqld" --console or

move to bin folder and type it as msqld --console.

if -- console opion is not used, it will write to the log file.


When the server finishes its startup sequence, you should see something like this, which indicates that the server is ready to service client connections:
E:\mysql-5.1.34-win32\bin>mysqld --console
090429 20:46:44 InnoDB: Started; log sequence number 0 46409090429
20:46:44 [Note] Event Scheduler: Loaded 0 events
090429 20:46:44 [Note] mysqld: ready for connections.
Version: '5.1.34-community' socket: '' port: 3306 MySQL Community Server (GPL)

mysqld: ready for connectionsVersion: '5.1.35' socket: '' port: 3306

Second question that comes to my is The Shutdown Process
mysqladmin shutdown
or ctrl + c will also shown the process but not suggested mechanism.

MySQL Server and Server-Startup Programs
E:\mysql-5.1.34-win32\bin>mysqladmin shutdown

mysqld, also known as MySQL Server, is the main program that does most of the work in a MySQL installation. MySQL Server manages access to the MySQL data directory that contains databases and tables. The data directory is also the default location for other information such as log files and status files.

When MySQL server starts, it listens for network connections from client programs and manages access to databases on behalf of those clients.
The mysqld program has many options that can be specified at startup. For a complete list of options, run this command: shell> mysqld --verbose --help


mysqld_multi is designed to manage several mysqld processes that listen for connections on different Unix socket files and TCP/IP ports. It can start or stop servers, or report their current status. The MySQL Instance Manager is an alternative means of managing multiple servers (see mysqlmanager).

shell> mysqld_multi [options] {startstopreport} [GNR[,GNR] ...]

this option is not avaiable in windows. Not sure... where to look.

In the previous step, I found that when we use mysqladmin shutdown
it did not allowed me to shutdown the ,mysql process. so use instead
-mysqladmin -u root shutdown

you will find following in the console

090429 21:38:07 [Note] mysqld: Normal shutdown

090429 21:38:07 [Note] Event Scheduler: Purging the queue. 0 events
090429 21:38:07 InnoDB: Starting shutdown...
090429 21:38:09 InnoDB: Shutdown completed; log sequence number 0 46409
090429 21:38:09 [Warning] Forcing shutdown of 1 plugins
090429 21:38:09 [Note] mysqld: Shutdown complete


No comments:

Post a Comment