MySQL5.14 販売管理データ登録済みセットのダウンロード

  ダウンロード




ブラウザでダウンロード

簡易的ではありますが、販売管理テーブルとデータを登録済みのデータベースを
解凍して install.bat を実行すると使えるようにパッケージしました。
( ODBC ドライバもオリジナルのものを同梱しています )

C:\ にダウンロードしてそのまま解凍して、C:\mysql514 というディレクトリ
内に全てのファイルがある状態にして install.bat を実行して下さい


元々、インストーラから UTF-8 でインストールして、一箇所にまとめ直したものなので、
MySQL そのものはオリジナルのままです。
( MySQL5.1.4 のインストール後、分散されたインストール場所を手作業で統合 )

データーベース名 : lightbox
ユーザ名 : root
パスワード : password

mysql の user テーブル内は localhost と % に対して同じパスワードを設定しています。
変更する場合は以下の SQL を実行すると良いでしょう

キャラクタセットの変更は、set character set ujis または、set names 'ujis' の
ようにして変更します( MySQL :: MySQL 5.1 リファレンスマニュアル :: 12.5.3 SET 構文 )
※ 厳密には二つの処理は違うようなので、注意してマニュアルを参照して下さい
※ 使用可能なキャラクタセットは、SHOW CHARACTER SET で確認します


euc-jp の場合
set character set eucjpms

shift_jis の場合
set character set cp932

▼ localhost 用
  
GRANT ALL PRIVILEGES ON *.* 
	TO root@localhost
	IDENTIFIED BY 'password'
	WITH GRANT OPTION
  

▼ 外部からの接続用
  
GRANT ALL PRIVILEGES ON *.* 
	TO root@'%'
	IDENTIFIED BY 'password'
	WITH GRANT OPTION
  

uninstall.bat を実行するとサービスから削除されます


※ ライセンスは GPL です。
※ オリジナルソースコードです > http://winofsql.jp/download/mysql-5.1.40.zip


▼ 既存の SHIFT_JIS のアプリから利用する場合の設定
Mysql51odbc

動的に設定したい場合は、以下を参考にして下さい
VBScript + ADO : 汎用CSV出力

ParameterDefault ValueComment
userODBCThe user name used to connect to MySQL.
uidODBCSynonymous with user. Added in 3.51.16.
serverlocalhostThe host name of the MySQL server.
database The default database.
option0Options that specify how Connector/ODBC should work. See below.
port3306The TCP/IP port to use if server is not localhost.
initstmt Initial statement. A statement to execute when connecting to MySQL. In version 3.51 the parameter is called stmt. Note, the driver supports the initial statement being executed only at the time of the initial connection.
password The password for the user account on server.
pwd Synonymous with password. Added in 3.51.16.
socket The Unix socket file or Windows named pipe to connect to if server is localhost.
sslca The path to a file with a list of trust SSL CAs. Added in 3.51.16.
sslcapath The path to a directory that contains trusted SSL CA certificates in PEM format. Added in 3.51.16.
sslcert The name of the SSL certificate file to use for establishing a secure connection. Added in 3.51.16.
sslcipher A list of allowable ciphers to use for SSL encryption. The cipher list has the same format as the openssl ciphers command Added in 3.51.16.
sslkey The name of the SSL key file to use for establishing a secure connection. Added in 3.51.16.
charset The character set to use for the connection. Added in 3.51.17.
sslverify If set to 1, the SSL certificate will be verified when used with the MySQL connection. If not set, then the default behavior is to ignore SSL certificate verification.
readtimeout The timeout in seconds for attempts to read from the server. Each attempt uses this timeout value and there are retries if necessary, so the total effective timeout value is three times the option value. You can set the value so that a lost connection can be detected earlier than the TCP/IP Close_Wait_Timeout value of 10 minutes. This option works only for TCP/IP connections, and only for Windows prior to MySQL 5.1.12. Corresponds to the MYSQL_OPT_READ_TIMEOUT option of the MySQL Client Library. This option was added in Connector/ODBC 3.51.27.
writetimeout The timeout in seconds for attempts to write to the server. Each attempt uses this timeout value and there are net_retry_count retries if necessary, so the total effective timeout value is net_retry_count times the option value. This option works only for TCP/IP connections, and only for Windows prior to MySQL 5.1.12. Corresponds to the MYSQL_OPT_WRITE_TIMEOUT option of the MySQL Client Library. This option was added in Connector/ODBC 3.51.27.



  動作確認用 PHP コード ( クライアント / shift_jis )



  
<?
if ( substr(PHP_OS,0,3) == 'WIN' ) {
	if ( !extension_loaded( "mysql" ) ) {
		dl("php_mysql.dll");
	}
}

$Server = 'localhost';
$DbName = 'lightbox';
$User = 'root';
$Password = 'password';

// 接続
$Connect = @mysql_connect( $Server, $User, $Password );
if ( !$Connect ) {
	print "接続エラーです";
	exit();
}

// DB選択
mysql_select_db( $DbName, $Connect );
mysql_query("set character set sjis", $Connect);

// クエリ
$result = mysql_query("select * from 社員マスタ", $Connect);
// 列数
$nField = mysql_num_fields( $result );
$nCount = 0;
print "<TABLE>\n";
while ($row = mysql_fetch_row($result)) {
	print "<TR>\n";
	print "\t<TD>" . ($nCount + 1) . "</TD>\n";
	for( $i = 0; $i < $nField; $i++ ) {
		print "\t<TD>{$row[$i]}</TD>\n";
	}
	print "</TR>\n";
	$nCount++;
}
print "</TABLE>";

// メモリを開放ですが、通常は必要ありません
mysql_free_result($result);

// 接続解除
mysql_close($Connect);
?>
  



  動作確認用 VBScript コード

  
strDriver = "{MySQL ODBC 5.1 Driver}"
strTarget = "localhost"
strDB = "lightbox"
strUser = "root"
strPass = "password"

' ***********************************************************
' ADO + FileSystemObject
' ***********************************************************
Set Cn = CreateObject( "ADODB.Connection" )
Set Rs = CreateObject( "ADODB.Recordset" )
Set Fso = CreateObject( "Scripting.FileSystemObject" )

' **********************************************************
' 接続文字列
' charset=sjis は MySQL 専用
' **********************************************************
ConnectionString = _
	"Provider=MSDASQL;" & _
	"Driver=" & strDriver & ";" & _
	"SERVER=" & strTarget & ";" & _
	"DATABASE=" & strDB & ";" & _
	"UID=" & strUser & ";" & _
	"PWD=" & strPass & ";" & _
	"charset=sjis;"

' **********************************************************
' 接続
' クライアントカーソル(3)を使う事が推奨されます
' **********************************************************
Cn.CursorLocation = 3
on error resume next
Cn.Open ConnectionString
if Err.Number <> 0 then
	WScript.Echo Err.Description
	Wscript.Quit
end if
on error goto 0

Query = "select * from `社員マスタ`"

' **********************************************************
' レコードセット
' オブジェクト更新時はレコード単位の共有的ロック(3)を
' 使用します( デフォルトでは更新できません )
' ※ デフォルトでも SQLによる更新は可能です
' **********************************************************
'Rs.LockType = 3
on error resume next
Rs.Open Query, Cn
if Err.Number <> 0 then
	Cn.Close
	Wscript.Echo Err.Description
	Wscript.Quit
end if
on error goto 0

' **********************************************************
' 出力ファイルオープン
' **********************************************************
Set Csv = Fso.CreateTextFile( "社員マスタ.csv", True )

' **********************************************************
' タイトル出力
' **********************************************************
Buffer = ""
' 社員コードと氏名のみ
For i = 0 to 1
	if Buffer <> "" then
		Buffer = Buffer & ","
	end if
	Buffer = Buffer & Rs.Fields(i).Name
Next
Csv.WriteLine Buffer

' **********************************************************
' データ出力
' **********************************************************
UpdateCnt = 0
Do While not Rs.EOF
	Buffer = ""
	Buffer = Buffer & Rs.Fields("社員コード").Value
	Buffer = Buffer & "," & Rs.Fields("氏名").Value

	Csv.WriteLine Buffer
	Rs.MoveNext
	UpdateCnt = UpdateCnt + 1
Loop

' **********************************************************
' ファイルクローズ
' **********************************************************
Csv.Close
' **********************************************************
' レコードセットクローズ
' **********************************************************
Rs.Close
' **********************************************************
' 接続解除
' **********************************************************
Cn.Close
  










  infoboard   管理者用   
このエントリーをはてなブックマークに追加





フリーフォントWEBサービス
SQLの窓WEBサービス

SQLの窓フリーソフト

素材

一般WEBツールリンク

SQLの窓

フリーソフト

JSライブラリ