mysql.exe 参数_MySQL Server 5.0–安装及配置/MySQLInstanceConfig.exe用法详解

配置MySQL步骤:

1. 运行MySQL

Server安装目录下bin/MySQLInstanceConfig.exe。出现如下所示的向导界面

a4c26d1e5885305701be709a3d33442f.png.

点击“Next”进入下一步。

2. 如果MySQLInstanceConfig在MySQL

Server的安装目录下找到my.ini文件,就会询问:是重新配置MySQL还是删除MySQL

service(同时删除my.ini文件)。

a4c26d1e5885305701be709a3d33442f.png

否则的话,出现下面的配置界面:

a4c26d1e5885305701be709a3d33442f.png

Detailed Configuration:自己配置大部分,更好地控制MySQL Server,让它更好地发挥作用。

Standard Configuration:系统配置大部分,不希望关注很多的Server配置。

这里选择“Detailed Configuration”,下一步(Next)。

3. 出现选择服务类型:

a4c26d1e5885305701be709a3d33442f.png

Developer Machine:主要为了个人使用,占用系统最少的资源。

Server Machine:主要用于像FTP,email,web服务器等等,耗用系统较多的资源。

Dedicated MySQL Server Machine:只用作MySQL服务器,不运行其他程序。耗用系统所有可用的资源。

个人学习研究用,选“Developer Machine”,下一步(Next)。

4. 出现设置数据库用法:

a4c26d1e5885305701be709a3d33442f.png

Multifunctional Database:使得InnoDB和MyISAM存储引擎都可用,且资源平分。

Transactional Database

Only:使得InnoDB和MyISAM存储引擎都可用,但是InnoDB使用较多资源。

Non-Transactional Database Only:使InnoDB不可用,所有资源分配给MyISAM。

选择“Multifunctional Database”,下一步(Next)。

5. 设置InnoDB

datafile存放位置,默认即可,下一步(Next)。

a4c26d1e5885305701be709a3d33442f.png

6. 出现选择并发连接设置对话框:

a4c26d1e5885305701be709a3d33442f.png

Decision Support(DSS)/OLAP:不需要大量的并发连接(20个左右)。默认值为100。

Online Transaction Processing(OLTP):需要大量的并发连接,默认值为500。

Manual Setting:个人设定了。

选择“Manual Setting”,从下拉框中选择10,下一步(Next).

7. 网络设定:

a4c26d1e5885305701be709a3d33442f.png

默认的端口号为3306,如果端口被占用或不希望使用3306,可以更换。下一步(Next)。

8. 选择缺省的字符集:

a4c26d1e5885305701be709a3d33442f.png

Standard Character Set:Latin1为默认的字符集。主要用于西方欧洲国家的语言。

Best Support For Multilingualism:UTF8为默认的字符集。

Manual Selected Default Character Set /

Collation:个人设定。(如果你希望数据库支持汉字,请选择gb2312)。

选择缺省的“Standard Character Set”,下一步(Next)。

9. 设置服务名称,最好将“Include

Bin Directory in Windows PATH”勾选:

a4c26d1e5885305701be709a3d33442f.png

10. 密码的设置,其余为默认:

a4c26d1e5885305701be709a3d33442f.png

11. 执行,使配置生效。

a4c26d1e5885305701be709a3d33442f.png

配置过程中出现的问题:

1. 在最后一个环节,执行到第四步,出现如下所示的错误。

a4c26d1e5885305701be709a3d33442f.png

此时,按Skip跳出,再重新执行MySQLInstanceConfig,重复上次的选项,执行就可以通过了。

这个主要出现在remove instance之后。

2. Client does not support authentication

protocol.

工具连接数据库时,若出现上述信息,请到命令行方式下对密码进行转换:

mysql> SET PASSWORD FOR

‘root’@’localhost’ = OLD_PASSWORD(‘newpassword’);

4.1版本之后的密码采用password hashing

algorithm,有些工具连接数据库可能需要转换。

3.连接MySQL服务器时,如果不是同一台PC机,出现连接不上。

在“设置->控制面板->Windows防火墙”,点击“例外”标签,“添加端口”后,出现:

a4c26d1e5885305701be709a3d33442f.png

适当设置范围。端口号为先前设定的端口号。

MySQLInstanceConfig的命令行参数:

To use the Instance Configuration Wizard from the command line the

following parameters can be used. These parameters have to be set

to run from the command line

-n

-p (no /bin)

-v

Actions to perform

-i (install

instance)

-r (remove

instance)

-s (stop

instance)

-q (be

quiet)

-lfilename (write

log file)

When launched manually, these can also be submitted

-t<.cnf template filename>

-c<.cnf filename>

Use the following option to define the parameters for the config

file generation.

ServiceName=$

AddBinToPath={yes | no}

ServerType={DEVELOPMENT | SERVER | DEDICATED}

DatabaseType={MIXED | INNODB | MYISAM}

ConnectionUsage={DSS | OLTP}

ConnectionCount=#

SkipNetworking={yes | no}

Port=#

StrictMode={yes | no}

Charset=$

RootPassword=$

RootCurrentPassword=$

The return codes of the Wizard in case of an error are.

2 ... Configuration template file cannot be found.

3 ... The Windows service entry cannot be created.

4 ... Could not connect to the Service Control Manager.

5 ... The MySQL service cannot be started.

6 ... The MySQL service cannot be stopped.

7 ... The security settings cannot be applied.

8 ... The configuration file cannot be written.

9 ... The Windows service entry cannot be removed.

Examples:

The following command installs a MySQL Server 5.0 instance from the

directory C:/Programme/MySQL/MySQL Server 5.0 using the service name

MySQLCust and settingthe root password to 1234.

MySQLInstanceConfig.exe -i -q "-lC:/mysql_install_log.txt" "-nMySQL

Server 5.0" "-pC:/Programme/MySQL/MySQL Server 5.0" -v5.0.13

"-t../../res/my-template.ini"

"-cC:/mytest.ini" ServerType=DEVELOPMENT DatabaseType=MIXED ConnectionUsage=DSS

Port=3311 ServiceName=MySQLCust RootPassword=1234

If the server can not be started, the exit code is 2.

The following command removes the server instance with the name

MySQLCust.

MySQLInstanceConfig.exe -r -q "-lC:/mysql_install_log.txt" "-nMySQL

Server 5.0" "-pC:/Programme/MySQL/MySQL Server 5.0" -v5.0.13 "-cC:/mytest.ini"

ServiceName=MySQLCust

Output into the log file:

----------------------------------------

Welcome to the MySQL Server Instance Configuration Wizard 1.0.6

Date: 2005-10-19 21:53:16

Installing service ...

Product

Name: MySQL

Server 5.0

Version: 5.0.13

Installation

Path: C:/Programme/MySQL/MySQL

Server 5.0/

Creating configuration file C:/mytest.ini using template

../../res/my-template.ini.

Options:

DEVELOPMENT

MIXED

DSS

STRICTMODE

Variables:

port: 3311

default-character-set: latin1

basedir: "C:/Programme/MySQL/MySQL Server 5.0/"

datadir: "C:/Programme/MySQL/MySQL Server 5.0/Data/"

Creating Windows service entry.

Service Name: "MySQLCust"

Parameters: "C:/Programme/MySQL/MySQL

Server 5.0/bin/mysqld-nt" --defaults-file="C:/mytest.ini"

MySQLCust.

Windows service MySQLCust installed.

Service started successfully.

The security settings could not be applied to the database because

the connection has failed with the following error.

Error Nr. 1045

Access denied for user 'root'@'localhost' (using password: NO)

----------------------------------------

Welcome to the MySQL Server Instance Configuration Wizard 1.0.6

Date: 2005-10-19 21:53:46

Removing Service...

Instance stopped.

Windows Service removed.

Service Name: MySQLCust

Configuration file removed.

Filename: C:/mytest.ini

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值