# mysql -u root mysqlmysql> UPDATE user SET Password=PASSWORD('newpassword') where USER='root';mysql> FLUSH PRIVILEGES;mysql> quit
# /etc/init.d/mysql restart
# mysql -uroot -pEnter password:
1. 安裝Apahce, PHP, Mysql, 以及php連接mysql庫組件。
yum -y install httpd php mysql mysql-server php-mysql php-mcrypt
2. 配置開機啓動服務
/sbin/chkconfig httpd on [設置apache服務器httpd服務開機啓動] /sbin/chkconfig –add mysqld [在服務清單中添加mysql服務] /sbin/chkconfig mysqld on [設置mysql服務開機啓動]
/sbin/service httpd start [啓動httpd服務,與開機啓動無關] /sbin/service mysqld start [啓動mysql服務,與開機無關]
3.設置mysql數據庫root帳號密碼。
mysqladmin -u root password ‘newpassword’ [引號內填密碼]
4. 讓mysql數據庫更安全
mysql -u root -p
mysql> DROP DATABASE test; [刪除test數據庫]mysql> DELETE FROM mysql.user WHERE user = ”; [刪除匿名帳戶]mysql> FLUSH PRIVILEGES; [重載權限]
5. 按照以上的安裝方式, 配置齣來的默認站點目錄為/var/www/html/新建一個php腳本:
6. 新建一個數據庫﹐添加一個數據庫用戶﹐設置用戶權限。寫個php腳本測試一下數據庫連接吧。
mysql> CREATE DATABASE my_db;mysql> GRANT ALL PRIVILEGES ON my_db.* TO ‘user’@'localhost’ IDENTIFIED BY ‘password’; //安裝apache擴展yum -y install httpd-manual mod_ssl mod_perl mod_auth_mysql//安裝php的擴展yum install php-gdyum -y install php-gd php-xml php-mbstring php-ldap php-pear php-xmlrpc//安裝mysql擴展yum -y install mysql-connector-odbc mysql-devel libdbi-dbd-mysql
To make changes to this policy for one of the seven default values: Start the Microsoft Management Console. On the Console menu, click Ad...