So Tired !_! 逆水行舟, 不进则退!

26Dec/17

Window 下安装 Memcached

Posted by Nick Xu

官网上并未提供 Memcached 的Window平台安装包,我们可以使用以下链接来下载,你需要根据自己的系统平台及需要的版本号点击对应的链接下载即可:

在 1.4.5 版本以前 memcached 可以作为一个服务安装,而在 1.4.5 及之后的版本删除了该功能。因此我们以下介绍两个不同版本 1.4.4 及 1.4.5的不同安装方法:


memcached <1.4.5 版本安装

1、解压下载的安装包到指定目录。

2、在 1.4.5 版本以前 memcached 可以作为一个服务安装,使用管理员权限运行以下命令:

c:\memcached\memcached.exe -d install

注意:你需要使用真实的路径替代 c:\memcached\memcached.exe。

3、然后我们可以使用以下命令来启动和关闭 memcached 服务:

c:\memcached\memcached.exe -d start
c:\memcached\memcached.exe -d stop

4、如果要修改 memcached 的配置项, 可以在命令行中执行 regedit.exe 命令打开注册表并找到 "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\memcached" 来进行修改。

如果要提供 memcached 使用的缓存配置 可以修改 ImagePath 为:

"c:\memcached\memcached.exe" -d runservice -m 512

-m 512 意思是设置 memcached 最大的缓存配置为512M。

此外我们还可以通过使用 "c:\memcached\memcached.exe -h" 命令查看更多的参数配置。

5、如果我们需要卸载 memcached ,可以使用以下命令:

c:\memcached\memcached.exe -d uninstall

memcached >= 1.4.5 版本安装

1、解压下载的安装包到指定目录。

2、在 memcached1.4.5 版本之后,memcached 不能作为服务来运行,需要使用任务计划中来开启一个普通的进程,在 window 启动时设置 memcached自动执行。

我们使用管理员身份执行以下命令将 memcached 添加来任务计划表中:

schtasks /create /sc onstart /tn memcached /tr "'c:\memcached\memcached.exe' -m 512"

注意:你需要使用真实的路径替代 c:\memcached\memcached.exe。

注意:-m 512 意思是设置 memcached 最大的缓存配置为512M。

注意:我们可以通过使用 "c:\memcached\memcached.exe -h" 命令查看更多的参数配置。

3、如果需要删除 memcached 的任务计划可以执行以下命令:

schtasks /delete /tn memcached
5Aug/15

set nginx as Windows system service

Posted by Nick Xu

  1. Download the latest version of Windows Service Wrapper from here.
    • Current version as of this writing is v1.17.
  2. Rename winsw-1.xx-bin.exe to something like nginxservice.exe.
    • This is the name that will show up for the process that owns your nginx process.
  3. Place an XML file next to the exe with the same base name, e.g. nginxservice.xml. The contents should be like below (verify your nginx location).
    <service>
      <id>nginx</id>
      <name>nginx</name>
      <description>nginx</description>
      <executable>c:\nginx\nginx.exe</executable>
      <logpath>c:\nginx\</logpath>
      <logmode>roll</logmode>
      <depend></depend>
      <startargument></startargument>
      <stopargument>-s stop</stopargument>
    </service>
    
  4. Run the command nginxservice.exe install.
5Jun/15

windows at 定时任务

Posted by Nick Xu

at 命令的参数:
At计划在指定时间和日期在计算机上运行命令和程序。at 命令只能在“计划”服务运行时使用。如果在没有参数的情况下使用,则 at 列出已计划的命令。
at [[\\ComputerName] hours:minutes [/interactive] [{/every:date[,...]|/next:date[,...]}] command]
参数
\\computername
指定远程计算机。如果省略该参数,则 at 计划本地计算机上的命令和程序。
ID
指定指派给已计划命令的识别码。
/delete
取消已计划的命令。如果省略了 ID,则计算机中所有已计划的命令将被取消。
/yes
删除已计划的事件时,对来自系统的所有询问都回答“是”。
hours:minutes
指定命令运行的时间。该时间用 24 小时制(即从 00:00 [午夜] 到 23:59)的 小时: 分钟格式表示。
terative
对于在运行 command 时登录的用户,允许 command 与该用户的桌面进行交互。
/every:
在每个星期或月的指定日期(例如,每个星期四,或每月的第三天)运行 command 命令。
date
指定运行命令的日期。可以指定一周的某日或多日(即,键入 M、T、W、Th、F、S、Su)或一个月中的某日或多日(即,键入从 1 到31 之间的数字)。用逗号分隔多个日期项。如果省略了 date,则 at 使用该月的当前日。
/next:
在下一个指定日期(比如,下一个星期四)到来时运行 command。
command
指定要运行的 Windows 命令、程序(.exe 或 .com 文件)或批处理程序(.bat 或 .cmd 文件)。当命令需要路径作为参数时,请使用绝对路径,也就是从驱动器号开始的整个路径。如果命令在远程计算机上,请指定服务器和共享名的通用命名协定 (UNC) 符号,而不是远程驱动器号。
/?
在命令提示符显示帮助.

 

每天8点关机,这个用的是星期,可以少输点,at 8:00 /every:m,t,w,th,f,s,su shutdown -s

Tagged as: , Comments Off
5Nov/13

在windows上以php-fpm的形式部署nginx服务器

Posted by Nick Xu

In case anyone still needs this info. This is how I setup php-fpm for use with nginx on windows:

Download the .zip file from http://windows.php.net/download/. The .zip file should be VC9 which has the FastCGI file (php-cgi.exe). Don't download VC6, and don't download the .msi file because it requires that you have IIS setup already in order to install php-fpm. The zip file contains the php-cgi.exe which is what you need for php-fpm. I downloaded a slightly older version, php-5.3.10-Win32-VC9-x86.zip, from here http://windows.php.net/downloads/releases/archives/ because I wanted to match the version running on my production server.

Unzip the file, e.g. unzip into C:\php-5.3.10-Win32-VC9-x86

Edit the php.ini file as needed. What I did:

# nginx security setting
cgi.fix_pathinfo=0

extension_dir = "C:\php-5.3.10-Win32-VC9-x86\ext"
enable the following modules by uncommenting them:

extension=php_curl.dll
extension=php_mbstring.dll
extension=php_mysqli.dll
Create a .bat file somewhere, e.g. start-php-fcgi.bat in nginx directory or in the php directory:

@ECHO OFF
ECHO Starting PHP FastCGI...
set PATH=C:\php-5.3.10-Win32-VC9-x86;%PATH%
C:\php-5.3.10-Win32-VC9-x86\php-cgi.exe -b 127.0.0.1:9123 -c C:\php-5.3.10-Win32-VC9-x86\php.ini
Double click the .bat file to start php-fpm. A window will popup and stay open while its running. Its kind of annoying, but just haven't looked into setting it up as service yet.

In the php section of nginx.conf I reference the 127.0.0.1:9123:

location ~ \.php$ {
fastcgi_pass 127.0.0.1:9123;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}

2Nov/12

Setup a Git server on Windows machine, with MSysGit and CopSSH(使用msysgit与copssh搭建基于windows的git服务器)

Posted by Nick Xu

On Server Box

1. install CopSSH
Be sure to install it to a folder without space in its name. I used C:\SSH. Then just press next until it finishes.
 
2. install MSysGit  

Be sure to install it to a folder without space in its name. I used C:\Git. The default values suits me well.
3. Config CopSSH
a. I would like to user a separate user for git access. So create a user from command line
 
net user git userspassword /add
b. Then, goto "Start | Programs | Copssh | 01. Activate a user" to activate the user.
Note, you should clear the 2nd checkbox, we'll generate keys later.
c. goto C:\SSH\etc folder, open the sshd_config file using wordpad (ornotepad2), don't use notepad, it's a UNIX format file. Remove the leading # character for item "PasswordAuthentication" and change the "yes" to "no". Also you can review the rest of the config file and change if necessary. For me, most of the default settings works fine.
 

d. Goto C:\SSH\home\git\.ssh folder, create a file named authorized_keys. Open this file using wordpad.

e. Install/extract Putty if you have not. Invoke PUTTYGEN.EXE to generate a pair of keys:
I used a 4096 bit SSH2 key. Save the private key to a folder and remember it. We'll use it later. Copy the content in the text box labelled with "Public key for pasting...." to the wordpad window you opened at step d, and save it, close the wordpad.

f. (Re)Start SSH Server. You can either reboot your PC, or use below command line:
net stop opensshserver
net start opensshserver

g. Now it's ready to test SSH connection. Invoke Putty.EXE, put localhost as host name, if you changed port in step c, don't forget to change it here. Navigate to Connection/SSH/Auth node, press the "Browse" button to select the private file you generated and stored in step e, as shown below:

You can save the settings to save you some typing next time. Google it if you don't know how. Now press "Open" button, you will see a warning window on first connection, press "Yes" to accept the key. Then a block terminal window pops up, with prompt "login as:", input "git" (without quote), and you should be prompted for a key-phrase if you set it when you saved the private key. Note, this is not the password of the git user you created during step a!!!. And with some luck (which you don't need if you know what you are doing), you should see some window similar to this:
If you've made it, congratulations, the hardest part is behind you. If you don't see it, then please review carefully what you have missed.

h. invoke a command window if you have not (where have you executed those "net xxx" commands?), and type
cd /d %USERPROFILE%
echo export HOME=/c/SSH/home/git > .bashrc

i. goto C:\SSH\home\git folder, open the .bashrc file (yes, the same name as in the above line). Insert below line to the first line: (AGAIN, THIS IS A UNIX FILE!)
export PATH=/cygdrive/c/Git/bin:/cygdrive/c/Git/libexec/git-core:$PATH
 

NOTE, above "export PATH=..." must be in the same line!
4. setup a Git repository.
goto C:\SSH\home\git and make a folder named test.git. Right click the folder and select "Git Bash" from context menu. (What? You did not choose the explorer integration? Goto start menu, find Git|Git Bash, and use command line to goto this folder). Then input below lines:
$ git init --bare
Initialized empty Git repository in C:/SSH/home/git/test.git/

Now the server setup is DONE. You might need a cup of coffee of a cake to ease your nerve.

Special notes no 2003 server. It seems the sshd will experience error if the user account used to login is not a member of administrator (thanks for the comment from Raphael). So if you experience problem, try to add the user's account to administrator group and try again.


On Client PC

1. Install MSysGit, as on server. You can choose any folder you like (better a folder without space in it's path).

2. Test connection, using Putty. Change the host name and port as in your environment. Don't forget the Connection | SSH | Auth node setting. Copy the private key file to client machine and point the file in this node. Then press "Open" button, you should find it similar to what you have experienced at step g above. But this time, after you logged in, you are actually logged in to another computer! After you logged in, type "git", and see if you have the familiar git help screen before you. If you see

-bash: git: command not found
then please check if you have step i done correctly.

3. Opne a command window, type

cd /d %USERPROFILE%
md .ssh

Then use windows explorer to open this folder. create a files (id_rsa.pub) if they don't exist.

4. Fire up PuttyGen.EXE again, load the private key you used at step 2. Paste the content of the text box to file id_ras.pub, and use menu "Conversions | Export OpenSSH key" to save to the folder you created at step 3, in name "id_rsa". Now the folder %USERPROFILE"\.ssh should have at least 2 files: id_rsa and id_rsa.pub

5. create a empty folder and invoke the Git Bash and navigate to that folder. Type
ssh git@your.remote.host "echo something"

input "yes" to accept the remote key. Then you should get an echo "something"


6. Now we are ready to clone the empty project we created at server
$ git clone ssh://git@tst/SSH/home/git/test.git
Initialized empty Git repository in D:/g/gt/test/.git/
warning: You appear to have cloned an empty repository.

Now you can make some change and push it back

$cd test
$vim readme.txt
$git add readme.txt
$git commit -a -m "first commit"
[master (root-commit) f216dfe] first commit

1 files changed, 1 insertions(+), 0 deletions(-)

create mode 100644 readme.txt
$ git push origin master

Counting objects: 3, done.
Writing objects: 100% (3/3), 236 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
To ssh://git@oti-tst/SSH/home/git/test.git
* [new branch] master -> master

Congratulations, you can clone and push back. It's not as hard as it sounds, after all 😀


 Setting up multiple accounts

I just realized that I forgot the part on how to make your repository accessible to multiple users. It's simple once you have gone through above steps: adding another user is just to generate another key-pair, and put the public-key into the authorized-key file. That's all. Then the new user can access your repository. (just follow the client setup, no other server settings needs to be changed).
I know a better way is to use Gitosis, but I'm not able to run it without cygwin yet :(
Tagged as: , , , No Comments
16Jul/12

Setting up a Mercurial server under IIS7 on Windows Server 2008 R2

Posted by Nick Xu

This guide walks you through setting up a Mercurial server under IIS7 on Windows Server 2008 R2.

Note: This post uses Mercurial 1.4.3 and Python 2.5.4, although this process will also work with Mercurial 1.5 and Python 2.6.4

Install Mercurial

First you’ll need to download and install Mercurial. I won’t walk through this as it’s a simple case of pressing "next" several times.

Install Python

Next you’ll need to install Python. Note that you need to use the same version of Python that was used to build Mercurial. This guide uses Mercurial 1.4.3 with Python 2.5.4, but if you’re installing Mercurial 1.5 then you’ll need to use Python 2.6 instead.

Be sure to install the x86 version of Python even if you’re running on an x64 system.

Get hgwebdir

Next you’ll need to download hgwebdir.cgi. This is the python script that will allow serving Mercurial repositories through a web server.

Hgwebdir is part of the Mercurial source code, so you’ll need to download the source package to get it. This can be found on the Mercurial site or you can check out the hg source by running the following command:

hg clone http://selenic.com/repo/hg

Once downloaded, hgwebdir.cgi is in the root of the source distribution.

Install IIS

Under Windows Server 2008 you can install IIS under the Server Manager and clicking "Add Roles". Proceed through the wizard and select the "Web Server (IIS)" role.

Under "Role Services" ensure that you enable Basic Authentication as well as CGI extensibility.

Configure Python for IIS

First, create a new directory under the wwwroot directory (C:inetpubwwwroot). I’m going to call it "hg".

In the "Handler mappings" section for this directory select "Add Script Map":

Next, enter *.cgi as the Request Path and the Executable Path should be set toc:Python25python.exe -u "%s". Enter "Python" as the Name.

At this point, you can test whether Python is working properly by creating a simple python script:

print 'Status: 200 OK'
print 'Content-type: text/html'
print

print '<html><head>'
print ''
print '<h1>It works!</h1>'
print ''
print ''

Save this in the directory that you created (C:inetpubwwwroothg) as test.cgi. Now, when you point your browser to http://localhost/hg/test.cgi you should see the following output:

Enabling hgwebdir.cgi

First, copy hgwebdir.cgi (that you downloaded in step 3) and paste it into c:inetpubwwwroothg. Open this file in a text editor and scroll down to the end. The last lines should look like this:

application = hgwebdir('hgweb.config')
wsgicgi.launch(application)

Change the first line to explicitly specify the path to your hg directory:

application = hgwebdir('c:inetpubwwwroothghgweb.config')
wsgicgi.launch(application)

Next, you’ll need to unzip the Mercurial library into c:inetpubwwwroothg. This can be found inLibrary.zip under the c:program files (x86)Mercurial directory.

You’ll now need to copy the hgweb templates directory into c:inetpubwwwroothg. This is located in the root of the Mercurial installation directory (C:program files (x86)Mercurial)

Finally, create a file called hgweb.config in c:inetpubwwwroothg. This file can be empty for now (we’ll be putting something in it shortly).

At this point, visiting http://localhost/hg/hgwebdir.cgi will show you an empty repository page:

Configuring Repositories

Now you’ll need to create some repositories to publish. To do this, create a directory in the root of the C: drive called "Repositories". This is where our repositories are going to be stored.

Next, I’m going to create a "test" repository by issuing the following commands:

cd c:repositories
mkdir test
hg init test

Now we have a repository created, we need to tell hgwebdir where to find it. We can do this by opening up the hgweb.config file we created earlier and adding the following lines:

[collections]
C:repositories = C:repositories

Now, visiting http://localhost/hg/hgwebdir.cgi should display our "test" repository

At this point it should now be possible to clone the test repository from the server with the following command:

hg clone http://localhost/hg/hgwebdir.cgi/test

Pretty URLs

Personally, I don’t like having to specify "hgwebdir.cgi" in the URLs. I’d much prefer something like http://localhost/hg/test to access my test repository.

This can be achived by using the URL rewriting extension for IIS which can be downloaded from Microsoft.

Once installed, you can access the URL rewriting settings though the "URL Rewrite" section of the IIS Manager. Select the "hg" subdirectory in the Connections pane and then select "URL Rewrite":

In the URL rewrite section add a new blank rule. The name of the rule is going to be "rewrite to hgwebdir".

Under the "Match URL" section set "Using" to "Wildcards" and set the "Pattern" to "*"

Under "Conditions" we want to ensure that we do not re-write URLs to any physical files, so add a condition for "Is Not a File":

In the "Rewrite URL" box at the bottom of the screen enter hgwebdir.cgi/{R:1}

The end result will look like this:

Finally, re-open your hgweb.config and add the following section:

[web]
baseurl = /hg

This will ensure that hgwebdir generates urls to /hg rather than /hg/hgwebdir.cgi

Now, visiting http://localhost/hg will display our repositories page and http://localhost/hg/test will show our test repository. Likewise, we can now clone repositories using this url format.

Pushing Changes

By default, all repositores served via hgwebdir are read only – you cannot push changes to them. To change this, we can specify the users that should be able to push to the repositores by adding an "allow_push" section to our hgweb.config:

[collections]
c:repositories = c:repositories

[web]
baseurl = /hg
allow_push = Jeremy

This means that the user account "Jeremy" (a local user account on the server) will have push access to the repository.

However, if we try and push changes we’ll get an error:

c:projectstest&gt;hg push
pushing to http://localhost/hg/hgwebdir.cgi/test
searching for changes
ssl required

For now, we’ll disable SSL by setting push_ssl to false in our hgweb.config:

[collections]
c:repositories = c:repositories

[web]
baseurl = /hg
allow_push = Jeremy
push_ssl = false

Now when we try and push we get a different error:

c:projectstest&gt;hg push
pushing to http://localhost/hg/hgwebdir.cgi/test
searching for changes
abort: authorization failed

This happens because by default IIS is serving up our site without authentication. We need to enable Basic Authentication in the Authentication area of IIS:

Now you’ll be prompted to enter your username and password:

After specifying the credetails, the changes will be pushed up. We can view the commit in our web UI:

Enabling SSL

When you use Basic authentication, your username and password will be sent over the wire in plain text. To make this more secure we can enable SSL. For this example I’m going to use a self-signed certificate, although this will also work with a real SSL certificate purchased from a provider.

First, you’ll need to go into the IIS manager, select "Server Certificates" and click "Create Self-Signed Certificate"

Now, add a binding for your Web Site for https on port 443 by right clicking on the site and selecting "Edit Bindings".

Add a new binding for https on port 443:

Once this is done, you should now be able to access the hgwebdir site by using https (https://localhost/hg). You’ll probably get an invalid certificate warning in your browser.

Now you can re-clone the repository using the secure url (also be sure to remove the "push_ssl = false" line from hgweb.config)

All done!

At this point, you should have successfully set up everything you need to use Mercurial in IIS7.

25May/10

(转)如何在Windows上安装多个MySQL

Posted by Nick Xu

免安装版的mysql(Without installer),其安装包的文件名类似于mysql-noinstall-5.1.31-win32.zip。因为它包含了完整安装包中除配置向导 以外的全部文件,所以需要你手动安装和配置MySQL的配置文件(my.ini)。

在Windows上安装多个MySQL的具体步骤如下:

(一)安装MySQL 5.1

1、MySQL免安装版下载地址

http://dev.mysql.com/downloads

文件格式:mysql-noinstall-version-win32.zip

在安装之前,请下载mysql-noinstall-5.1.31-win32.zip和mysql-noinstall-5.0.77- win32.zip这两个文件。

由于MySQL一直在升级,所以当您阅读本文时,或许在其官方网站上已提供了新的正式版下载,因此,请进入MySQL下载页面

http://dev.mysql.com/downloads/ 查找当前的最新可用版本。

另外,在下载过程中,会提示你需要注册为网络用户,这是一个很简短的过程,它需要您提供一个有效的 email地址。当然,如果不注册的话,你也可以跳过此步,直接下载既可。

2、解压缩并放置到你期望的目录下

(建议放置在不包含空格的目录下,如E:mysql )

为了方便,修改解压缩后的文件夹名为mysql,并放置在C:mysql (因为是配置文件里默认的路径。)

将下载后的mysql-noinstall-5.0.77-win32.zip解压到%MySQL_HOME%(此处%MySQL_HOME% 表示MySQL的安装路径,如我将其解压至E:dev,

为了方便,修改解压缩后的文件夹名为mysql

-5.1.31)。另外,为了便于日后备份和升级,最好把安装文件中的data目录存放在其它地方。此处,我在E盘新建一个目 录"MySQL5.1Data",然后把"E:devmysql-5.1.31"目录下的"data"子目录剪切到"E: MySQL5.1Data"目录中。

3、创建一个配置文件

对于服 务器每次启动都用到的选项和对MySQL服务的一些设置,你会发现使用配置文件来指定MySQL配置非常方便。

MySQL配置文件,一般放在Windows 系统目录中,如C:WINDOWS 或C:WINNT ,名为my.ini

。但是,此处我们是安装两个MySQL,因此将其放在MySQL解压缩后的文件夹中。在该文件夹中,一般包含5个MySQL自带的配置文件,my- small.ini、my-medium.ini、my-large.ini、my-huge.ini和my-innodb-heavy-4G.ini, 请你根据自己机器的

内存大小,选择其 一,并把它重新命名为my.ini用作基本配置文件。

配置文件中的一些参数,需要根据安装目录的不同,做相应的修改,如

[WinMySQLAdmin]

Server=E:/dev/mysql-5.1.31/bin/mysqld.exe

[mysqld]

basedir=E:/dev/mysql-5.1.31

datadir=E:/MySQL5.1Data/data

default-character-set=gbk

port=3306

[client]

default-character-set=gbk

port=3306

4、将MySQL加入到Windows 的服务中

打开MS-DOS窗口,进入DOS环境,切换到"%MySQL_HOME%bin"目录

运行:

%MySQL_HOME%bin>mysqld --install mysql5.1

(此时,在运行中输入"services.msc"或者打开"控制面板"->"管理工具"->"服务",可以看到服务列表中存 在"MySQL5.1"服务。如果不希望它自动运行,也可以改为手动,这样,当你不用它的时候,也可以节省内存。)

5、启动和停止MySQL服务

%MySQL_HOME%bin>net start mysql

或者进入DOS环境,进入如下目录运行:%MySQL_HOME%binmysqld.exe

(或直接双击mysqld.exe文件),即可启动MySQL服务

%MySQL_HOME%bin>net stop mysql(停止*MySQL*服务)

注:如果要卸载* MySQL *服务,请运行%MySQL_HOME%bin>mysqld --remove

(如果你不再需要MySQL了,请先停掉MySQL的服务,然后再把MySQL的服务卸载掉,最后删除MySQL安装目录即可。)

6、进入MySQL

%MySQL_HOME%binmysql -uroot -p (密码为空)

(如果出现ERROR 2003 (HY000): Can't connect to MySQL server on 'localhost'

(10061)提示,表示MySQL服务没有被启动,其主要的原因在于,配置文件写的不对。

如果出现ERROR 1045 (28000): Access denied for user

[email=]'root'@'localhost'[/email]

(using password: NO)提示,表示MySQL服务已经启动,但是你所输入的密码不正确。

如果出现1067的错误:A system error has occurred.System error 1067 has occurred.The

process terminated unexpectedly.提示,无法启动* MySQL *服务,进程意外终止,表示你的配置文件有问题,请检查

my.ini里面的路劲是否写错了或者试着删除MySQL5.1Data文件中的LOG文件。 )

mysql>select version(); (显示目前你所安装的 *MySQL的* 数据库版本信息)

如果上面的所有操作步骤均正常的话,那么恭喜你,你已安装好了 *MySQL* 5.1,下面我们继续安装 *MySQL* 5.0.

(二)安装MySQL 5.0

安装MySQL 5.0的步骤与安装MySQL 5.1的步骤类似,其中,有两个需要注意的地方为,

(1)在创建MySQL 5.0的配置文件时,port要设置成非3306(如3307等)端口。

(2)将MySQL加入到Windows 的服务中:

打开MS-DOS窗口,进入DOS环境,切换到"%MySQL_HOME%bin"目录

运行: %MySQL_HOME%bin>mysqld-nt --install mysql5.0

*注意*:mysqld(或mysqld.exe)是 MySQL

server数据库服务器的相关程序,而mysqld-nt(或mysqld- nt.exe)是MySQL Daemon数据库服务的相关程序,在MySQL

5.1(此处的版本为5.1.31)中仅有mysqld(或mysqld.exe),在MySQL 5.0(此处的版本为5.0.77)中,这两者都有。

Tagged as: , No Comments
21May/10

为Windows 7 Professional安装多语言包

Posted by Nick Xu

现在越来越多的人开始用Windows 7了,尤其是正在国外留学的中国学生,得利于学校和微软的合作项目,很多学生都能免费得到一份正版的外文Windows 7 专业版, 或者是以非常优惠的价格的买到家庭版。但由于这两个版本的MUI(Multi User Interface) 功能被禁用了,不能安装中文语言包,难免使得很多习惯了用中文版的同学感到头痛。

经过几日的搜索,总算是在网上搜到了一个非常完美的解决方案 !如下 :

  • - 准备好要安装的语言包,通常是一个 lp.cab文件
  • - 将文件包放入任意盘的根目录(此步骤,是为了简化之后要使用的命令)
  • - 以管理员身份运行 cmd.exe (命令提示符) (右键点击All programs中的Command Prompt,选择Run as administrator)
  • - 在黑色的Command Prompt窗口中输入以下指令 :
  1. DISM /Online /Add-Package /PackagePath:(语言包路径)
    例如我的语言包放在D:\,則輸入 DISM /Online /Add-Package /PackagePath:D:\
    等到进度提示显示100%,显示安装成功类似的一句话之后,输入:
  2. bcdedit /set {current} locale zh-cn
    完成后再输入:
  3. bcdboot %WinDir% /l zh-cn
    上面这两个指令应该很快就完成了。
  • - 在执行regedit,修改注册表:
    在 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\MUI\UILanguages 中找到 en-us(或是异于中文的其他标识), 将它删除
  • - 重启计算机,完成!

此方法分别在64位和32位的windows 7 英文专业版、法文专业版以及法文家庭版上测试成功!

   
site
site