VineLinux4.1でphp+MySQLサーバー構築
vine変w PATH=$PATH:$HOME:/sbin 再ログインして・・・ふぅ〜。 php関係をインストール mysql5をインストール・起動・自動起動設定 apache2を起動・自動起動設定 /var/www/html にinfo.phpを置いて ●mysqlの設定 mysql -u root -p rootで入る デフォで入っているつかわないユーザーとdbを削除しよう。 Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer. mysql> use mysql Database changed mysql> delete from db where User=”; mysql> flush privileges; ●mysqlにユーザー追加 ユーザーuhyahya でパスワードohyahya で作成 mysql> grant all privileges on uhyahya.* to hoge identified by ‘ohyahya’;
serviceやchkconfigコマンドが/sbinに居るのだけどパスが通っていない。
いちいち /sbin/chkconfig とか打ちたくないので.bash_profileにPATH設定。
export PATH
環境を修正すると気分が良い。
apt-get install php5 php5-apache2 php5-devel php5-pear php5-mysql
apt-get install MySQL-server MySQL-client
service mysql start
chkconfig mysql on
service apache2 start
chkconfig apache2 on
< ?php phpinfo() ?>
を書いておく。
ブラウザでinfo.phpを読みに行ってphp情報が表示されたらOK,
その中にmysqlの項目があることも確認しよう。
mysql> set password for root@localhost=password(’パスワード’); パスワードを設定する(必須、コピペ禁止)
このコマンドはコピペするとうまくいかないことがありました。面倒なことになるのでちゃんと打ちましょう。
セキュリティの問題となるので。
$ mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 5.0.27-standard
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
mysql> delete from user where User=”;
Query OK, 2 rows affected (0.02 sec)
Query OK, 2 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
root使っても良いけどきもちわるくないかい?
Query OK, 0 rows affected (0.00 sec)
TrackBack URI : http://www.inohome.net/kuma/blog/archives/2007/09/post_1245.html/trackback
コメント (0)







