In my last blog entry, I discussed a “silent” install method for deploying MySQL on Windows. However, the best way to distribute MySQL may be to not install it. Instead, design the application to launch mysql from the command line. With this method, you can deploy with two files, avoid registry entries, and hide database files from end-users and their IT staff.
[Note: these instructions may also be useful if you can't get the MySQL installer to run on a particular Windows machine. I find it easier to copy the system tables from an existing install of MySQL that was deployed with the Windows MSI installer. Nevertheless, you could download the "without installer" MySQL zip file and use the mysql_system_tables.sql and mysql_system_table_data.sql to create your system tables. I had to remove the "WHERE @had_user_table=0" from the mysql_system_table_data.sql to get it to work. The SC.exe tool can be used to add it to the services]
The following is a minimum install example. I prefer to run the full install using the Windows Essentials or the Windows MSI Installer download from http://dev.mysql.com/downloads/mysql/5.1.html#win32 . Stop the service and use the files that were generated from the install to set up MySQL on your target machine.
Step 1. Create an empty directory on the target server. I created c:\min. From an existing MySQL install, copy the following files into c:\min:
mysqld.exe
errmsg.sys
In my unmodified 5.1 version, mysqld.exe is 8.2 MB and errmsg.sys is 36K. The following command will launch the full version of the server with only the aforementioned files:
Step 2. c:\min>mysqld.exe --language=. --datadir=. --skip-grant-tables --bind-address=localhost
That’s it. MySQL is running and you can now connect and create tables.
I used the following server options:
This is an essential parameter. Your install needs to find errmsg.sys to start. I retrieved this file from the “share” folder in an existing installation.
--language=.
--datadir=. This determines the location of the data directory. In my simple example, I put the data files in the application directory. You may prefer to specify a data directory in the recommended Windows application directory.
--skip-grant-tables This variable allows MySQL to load without the privileges table. Anyone can connect without authenticating. I’ve specified --bind-address for only local connections. If you’re deploying to a server in a secure location on a private network and MySQL is only running when your application is running, this may be acceptable.
--bind-address=localhost This option determines the IP address for which to bind, it will only listen on localhost. As an alternative, it’s possible to run MySQL on windows with named pipes or shared memory.
To force authentication, you will need to include the privilege tables. In this case, create a data directory. In my case I used c:\min\data . Then, copy the mysql folder from an existing install into the data directory. Then, start MySQL and specify the new data directory:
c:\min>mysqld.exe --language=. --datadir=./data
Since these are MyISAM files, MySQL will recognize the additional database and files. Also, omit the --skip-grant-tables parameter. Now, you’ll be prompted for a password. It will be the same password that you specified when you ran the full install.
MySQL is running. What’s next? If you’re deploying an application, you’ll need to deploy your initial schema and data. The simplest way would be to dump the schema and tables from your development machine and then load in the sql script on your target server. Documentation for dumping a loading and database can be found here: http://dev.mysql.com/doc/refman/5.1/en/mysqldump.html
There are many startup options and system variables which can be specified on the command line or the configuration file (--defaults-file).
Here are the appropriate links:
http://dev.mysql.com/doc/refman/5.1/en/server-options.html
http://dev.mysql.com/doc/refman/5.1/en/using-system-variables.html
If only using MyISAM, you might want to start MySQL with --skip-innodb. You can use these options to make your installation more secure. You may want to change the default TCP/IP port. If using InnoDB, you can set innodb-data-file-path to a different location, a more obscure filename and a different size. This would prevent someone from copying the data to another computer and trying to access the data with a different application.
There are other ways to deploy MySQL with your application, including using the “silent” install method or using the deeply embedded library (libmysqld). If you’d prefer that your customer has full visibility and access to MySQL, a “silent” install adds MySQL to the program files, service control panel and the Add/Remove program options. If you’re developing a stand-alone application in C/C++, the deeply embedded library (libmysqld) provides excellent performance with a small footprint. Otherwise, your best option may be to launch MySQL from the command line. This method provides a simple and lightweight deployment with all the MySQL server capabilities.
[...] This method provides a simple and lightweight deployment with all the MySQL server capabilities. Read the full article the source. Share Code mysql install oem deploy, uncategorized On SQL vs No-SQL MySQL [...]
Pingback by Launch MySQL from the Command Line | Web Developer — December 5, 2009 @ 12:48 pm |
hello… i would like to ask if this can handle blob data?
Comment by Unknown Soldier — February 19, 2010 @ 2:36 pm |
It’s OK nude lolita
mls
Comment by Dnzyjqft — September 6, 2011 @ 6:27 pm |
A First Class stamp ovens bbs
413869
Comment by Urvmhfdd — September 7, 2011 @ 6:14 pm |
Will I be paid weekly or monthly? Topless Lolita 1014
Comment by Hjchkute — September 19, 2011 @ 11:04 pm |
I like watching TV Macie Teen Model
%)
Comment by Xbfdfjvl — September 25, 2011 @ 3:35 pm |
Where’s the postbox? Preteen Cuties
8043
Comment by Ylmziyjl — December 5, 2011 @ 3:35 pm |
I experimented with looking at your website on my cellphone and the structure does not seem to be right. Might want to check it out on WAP as well as it seems most cell phone layouts are not working with your website.
Comment by here — May 27, 2012 @ 4:53 pm |
Hi, I did what you said and I get error when testing the command in cmd in Widnows 7: can´t find messagefile ‘c:\users\usernamexxx\errmsg.sys’. But I did include it in my application folder. I found several ones, I used the english one, and my Windows is in spanish, could it be the cause? Thanks in advance.
Comment by Denis — August 23, 2012 @ 9:13 pm |
Where do you live?
Comment by Uvfuyiuf — September 4, 2012 @ 5:38 pm |
I already solved it, you must put before the command “cd my-dir” so it executes the command in the dir where you put the err.sys.
But, in Windows 7, when testing in the cmd, it must be opened in elevated mode for it works, and I cannot do it in Visual Basic. Any ideas?
Comment by Denis — September 4, 2012 @ 6:24 pm |
International directory enquiries
Comment by Bsouhkrz — December 30, 2012 @ 2:10 pm |
I never went to university
Comment by Pzizdmgp — December 31, 2012 @ 9:12 am |
A staff restaurant
Comment by Uuotoviw — December 31, 2012 @ 10:26 am |
I’ve been cut off http://order-generic-levitra-online-e.webspawner.com/ levitra buy levitra the importance of work flow and its effect on medication safety. Demonstrate an
Comment by Anthony — February 8, 2013 @ 2:21 pm |
Who’s calling?
Comment by Victoria — February 11, 2013 @ 7:49 pm |
What’s the interest rate on this account? http://www.asiantigers-japan.com albendazole prescription drug used for those Patients covered by a Community Services Card.
Comment by Anna — March 16, 2013 @ 11:55 am |
Withdraw cash http://arishort.com buy tamoxifen citrate us accountability, ethical sound decision making, and leadership.
Comment by Melissa — March 16, 2013 @ 7:30 pm |
What are the hours of work? http://www.zoji.com/1230676 best child loli sites i got so dang horny after watching this…did anyone else. if it hasnt been long after you read my post i should be online still so meet me here discreetfun dot net im under jilljames
Comment by Tgocjhgo — April 8, 2013 @ 1:38 pm |
Could you transfer $1000 from my current account to my deposit account? http://www.zoji.com/1230682 lolita cp tgp portal dude its a free porn site. most of the quality is decent. either shut the fuck up or go pay for porn elsewhere
Comment by Frympaqz — April 8, 2013 @ 5:56 pm |
I need to charge up my phone Preteen Pay Sites cant stop thinking about licking that ass and pussy, mm fuck!
Comment by Savannah — April 9, 2013 @ 9:11 am |
What qualifications have you got? http://community.parents.com/asumouooi/blog/2013/04/04/lolita_kingdom_nude_pics lolita nudists photos images Dude, her Name is Tobi Pacific. She says it right in the beginning plus they even write it! WATCH! LOL
Comment by Bzuorajq — April 10, 2013 @ 3:34 am |
I’m on holiday lolita preteen ls magazine the best anal ever…she is squirting while he fuck her asshole
Comment by Jaden — April 10, 2013 @ 3:51 am |
Children with disabilities diflucan online order 80.05-3 Drugs That Require Authorization Prior to Provision (APTP
Comment by Evelyn — April 16, 2013 @ 11:22 am |