CentOS 装 LAMP 服务器(Apache2+PHP5+MySQL)
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] <– 回车
New password: <– 设置一个用户密码
Re-enter new password: <– 再输入一次你设置的密码
Password updated successfully!
评论0