mysql server5.0使用_MySQL Server 5.0–安裝及配置/MySQLInstanceConfig.exe用法詳解

这篇博客详细介绍了如何配置MySQL Server 5.0,包括运行MySQLInstanceConfig.exe,选择服务类型、数据库用法、并发连接设置、网络配置、字符集等步骤,以及解决配置过程中的常见问题和命令行参数的使用。
摘要由CSDN通过智能技术生成

配置MySQL步驟:

1.       運行MySQL Server安裝目錄下bin/MySQLInstanceConfig.exe。出現如下所示的向導界面

aHR0cDovL3d3dy50YW95b3lvLm5ldC90dHQvdXBsb2FkLzIwMTExMTA0X215c3FsXzAxLkpQRw==.

點擊“Next”進入下一步。

2.       如果MySQLInstanceConfig在MySQL Server的安裝目錄下找到my.ini文件,就會詢問:是重新配置MySQL還是刪除MySQL service(同時刪除my.ini文件)。

aHR0cDovL3d3dy50YW95b3lvLm5ldC90dHQvdXBsb2FkLzIwMTExMTA0X215c3FsXzAyLkpQRw==

否則的話,出現下面的配置界面:

aHR0cDovL3d3dy50YW95b3lvLm5ldC90dHQvdXBsb2FkLzIwMTExMTA0X215c3FsXzAzLkpQRw==

Detailed Configuration:自己配置大部分,更好地控制MySQL Server,讓它更好地發揮作用。

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

這里選擇“Detailed Configuration”,下一步(Next)。

3.       出現選擇服務類型:

aHR0cDovL3d3dy50YW95b3lvLm5ldC90dHQvdXBsb2FkLzIwMTExMTA0X215c3FsXzA0LkpQRw==

Developer Machine:主要為了個人使用,占用系統最少的資源。

Server Machine:主要用於像FTP,email,web服務器等等,耗用系統較多的資源。

Dedicated MySQL Server Machine:只用作MySQL服務器,不運行其他程序。耗用系統所有可用的資源。

個人學習研究用,選“Developer Machine”,下一步(Next)。

4.       出現設置數據庫用法:

aHR0cDovL3d3dy50YW95b3lvLm5ldC90dHQvdXBsb2FkLzIwMTExMTA0X215c3FsXzA1LkpQRw==

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

Transactional Database Only:使得InnoDB和MyISAM存儲引擎都可用,但是InnoDB使用較多資源。

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

選擇“Multifunctional Database”,下一步(Next)。

5.       設置InnoDB datafile存放位置,默認即可,下一步(Next)。

aHR0cDovL3d3dy50YW95b3lvLm5ldC90dHQvdXBsb2FkLzIwMTExMTA0X215c3FsXzA2LkpQRw==

6.       出現選擇並發連接設置對話框:

aHR0cDovL3d3dy50YW95b3lvLm5ldC90dHQvdXBsb2FkLzIwMTExMTA0X215c3FsXzA3LkpQRw==

Decision Support(DSS)/OLAP:不需要大量的並發連接(20個左右)。默認值為100。

Online Transaction Processing(OLTP):需要大量的並發連接,默認值為500。

Manual Setting:個人設定了。

選擇“Manual Setting”,從下拉框中選擇10,下一步(Next).

7.       網絡設定:

aHR0cDovL3d3dy50YW95b3lvLm5ldC90dHQvdXBsb2FkLzIwMTExMTA0X215c3FsXzA4LkpQRw==

默認的端口號為3306,如果端口被占用或不希望使用3306,可以更換。下一步(Next)。

8.       選擇缺省的字符集:

aHR0cDovL3d3dy50YW95b3lvLm5ldC90dHQvdXBsb2FkLzIwMTExMTA0X215c3FsXzA5LkpQRw==

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”勾選:

aHR0cDovL3d3dy50YW95b3lvLm5ldC90dHQvdXBsb2FkLzIwMTExMTA0X215c3FsXzEwLkpQRw==

10.    密碼的設置,其余為默認:

aHR0cDovL3d3dy50YW95b3lvLm5ldC90dHQvdXBsb2FkLzIwMTExMTA0X215c3FsXzExLkpQRw==

11.    執行,使配置生效。

aHR0cDovL3d3dy50YW95b3lvLm5ldC90dHQvdXBsb2FkLzIwMTExMTA0X215c3FsXzEyLkpQRw==

配置過程中出現的問題:

1. 在最后一個環節,執行到第四步,出現如下所示的錯誤。

aHR0cDovL3d3dy50YW95b3lvLm5ldC90dHQvdXBsb2FkLzIwMTExMTA0X215c3FsXzEzLkpQRw==

此時,按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防火牆”,點擊“例外”標簽,“添加端口”后,出現:

aHR0cDovL3d3dy50YW95b3lvLm5ldC90dHQvdXBsb2FkLzIwMTExMTA0X215c3FsXzE0LkpQRw==

適當設置范圍。端口號為先前設定的端口號。

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

windows 使用命令行運行數據庫:

1、首先切換到數據庫的安裝目錄:C:\Program Files\MySQL\MySQL Server 5.0\bin

2、mysql -hlocalhost -uroot -p(回車鍵)

(上面的-hlocalhost是指使用本地用戶來連接,-uroot是指使用用戶名為root的用戶來連接,-p是指空密碼,一般初學者都還沒有設置root的用戶密碼的,如果你在安裝mysql5.0時候配置了服務器后,第一個要您設置root的密碼,請你記住,把它填入上面的-p之后)

使用圖形化界面SQLyog登錄:

6d806805e7f402a70a46c43e2b092e46.png

本機登錄:localhost,用戶名:root,密碼自己記住。

轉自:http://blog.csdn.net/feihong247/article/details/7791105

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值