CentOS LAMP 安裝
yum -y install httpd php php-mysql mysql mysql-serve
★啟動 MySQL
chkconfig mysqld on
/etc/init.d/mysqld start
★啟動 Apache
chkconfig httpd on
/etc/init.d/httpd start
★設定 MySQL 資料庫管理者
mysql_secure_installation
1. Enter current password for root (enter for none): // 直接按 Enter,因為預設沒密碼
2. Set root password? [Y/n] //輸入 Y 來設定密碼
3. New password: // 輸入 root 新密碼
4. Re-enter new password: // 再一次輸入 root 新密碼
5. Remove anonymous users? [Y/n] //預設 Yes ,直接按 Enter
6. Disallow root login remotely? [Y/n] //預設 Yes ,直接按 Enter
7. Remove test database and access to it? [Y/n] //預設 Yes ,直接按 Enter
8. Reload privilege tables now? [Y/n] //預設 Yes ,直接按 Enter
★授與某位使用者為某個資料庫的管理者
mysql -u root -p
mysql> use mysql;
mysql> create database your_db_name;
mysql> insert into user (host,user,password) values ('%','your_account',password('your_password'));
mysql> grant usage on *.* to your_account@localhost identified by 'your_password';
mysql> grant all privileges on your_db_name.* to your_account@localhost ;
mysql> FLUSH PRIVILEGES;
安裝基本需要的套件
yum -y install php-mbstring php-mcrypt php-gd php-xml
yum -y install mod_ssl mod_perl mod_auth_mysql
留言