歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux綜合 >> Linux資訊 >> Linux業界 >> CentOS裝LAMP服務器(Apache2+PHP5+MySQL)

CentOS裝LAMP服務器(Apache2+PHP5+MySQL)

日期:2017/3/2 13:45:51   编辑:Linux業界

  1.重要提示:

  在本教程中使用的主機名為server1.example.com,IP 地址為 192.168.0.100 。這些設置會與具體安裝的設置有所不同,所以你必須在你的安裝過程中進行替代。

  2.安裝MySQL 5.0

  打開終端,輸入:

yum install mysql mysql-server

  然後為MySQL創建系統啟動鏈接(這樣在系統啟動時,MySQL會自動啟動),在終端輸入命令:

chkconfig --levels 235 mysqld on

/etc/init.d/mysqld start

  為MySQL root帳戶設置密碼:

 mysql_secure_installation

  終端顯示,按照提示操作:


[root@server1 ~]# mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!

In order to log into MySQL to secure it, we’ll need the current
password for the root user. If you’ve just installed MySQL, and
you haven’t set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
OK, successfully used password, moving on…

Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.

Set root password? [Y/n]

Copyright © Linux教程網 All Rights Reserved