Windows での,XAMPP for Windows のインストール,起動,セキュリティ上の最低限の設定手順をスクリーンショット等で説明する.
XAMPP の URL: http://www.apachefriends.org/jp/index.html
XAMPP for Windows 7.4.9 は,次のソフトウエアの詰め合わせ.
目次
このページで紹介するソフトウエア類の利用条件等は,利用者で確認すること.
※ XAMPP は学習用に適すると考えている. サーバを公開するのなら,セキュリティの設定が必要.その場合は,XAMPP を使わずに, 各ソフトを個別でインストールする方が簡単になる可能性がある.
次の手順で,XAMPP for Windows のダウンロードとインストールと動作チェックを行う.
ダウンロードが始まるので確認する.
ダウンロードした .exe ファイルを実行する
XAMPP コントロールパネルで,Apache と MySQL の右横が「Start」になっている場合には, Apache と MySQL が起動していないという意味なので,下記の手順で,手動で起動する。
まず,Apache の右横の「Start」をクリックする
XAMPP コントロールパネルで,Apache の開始を確認しておく
XAMPP コントロールパネルで,Apache の右横に「Stop」と表示されることも確認する.
Apache のときと同様の操作. XAMPP コントロールパネルで,MySQL の右横の「Start」をクリックする
XAMPP コントロールパネルで,MySQL の開始を確認しておく
XAMPP コントロールパネルで,Apache の右横に「Stop」と表示されることも確認する.
システム環境変数 PATH に次を追加する
C:\xampp\mysql\bin
Windowsのコマンドプロンプトを開き、次のコマンドを実行.
where mysql
XAMPP コントロールパネルで, 「MySQL」の右の 「Admin」をクリック.
インストール時のTCPポート「3306」がWindowsファイヤーウォールで承認されていないという場合がある. 次の手順でWindowsファイヤーウォールを設定すると直ることがある.
データベースを作成するために,SQL の create database コマンドを使用する.
utf8 の場合の生成例
create database testdb default character set utf8 collate utf8_unicode_ci;
cp932 の場合の生成例
create database testdb default character set cp932 collate cp932_japanese_ci;
show databases;
create table order_records (
id integer primary key not null,
year integer not null CHECK ( year > 2008 ),
month integer not null CHECK ( month >= 1 AND month <= 12 ),
day integer not null CHECK ( day >= 1 AND day <= 31 ),
customer_name text not null,
product_name text not null,
unit_price real not null check ( unit_price > 0 ),
qty integer not null default 1 check ( qty > 0 ),
created_at timestamp not null default current_timestamp,
updated_at timestamp not null default current_timestamp on update current_timestamp,
check ( ( unit_price * qty ) < 200000 ) );
start transaction; insert into order_records (id, year, month, day, customer_name, product_name, unit_price, qty) values( 1, 2020, 7, 26, 'kaneko', 'orange A', 1.2, 10 ); insert into order_records (id, year, month, day, customer_name, product_name, unit_price, qty) values( 2, 2020, 7, 26, 'miyamoto', 'Apple M', 2.5, 2 ); insert into order_records (id, year, month, day, customer_name, product_name, unit_price, qty) values( 3, 2020, 7, 27, 'kaneko', 'orange B', 1.2, 8 ); insert into order_records (id, year, month, day, customer_name, product_name, unit_price) values( 4, 2020, 7, 28, 'miyamoto', 'Apple L', 3 ); commit;
「order_records」をダブルクリックすると,エディタ画面に変わり,テーブルの中身が確認,編集できる.
select * from order_records;
start transaction; update order_records set unit_price = 11.2 where id = 1; commit; select * from order_records;
show tables;
mysqladmin --user=root password "(新しいパスワード)"
すでにパスワードを設定済みで,変更をしたい場合は,次のように操作.
mysqladmin --user=root --password=(古いパスワード) password "(新しいパスワード)"
http://localhost/cgi-bin/perltest.cgi
本サイトは金子邦彦研究室のWebページです.サイトマップは,サイトマップのページをご覧下さい. 本サイト内の検索は,サイト内検索のページをご利用下さい.
問い合わせ先: 金子邦彦(かねこ くにひこ) ![]()