LAMP架构部署和动态网站环境的配置( 四 )



3、install mariadb

# yum install mariadb.x86_64 mariadb-server.x86_64 mariadb-devel.x86_64 -y

# rpm -qa mariadb //查看mariadb是否安装成功

# systemctl start mariadb.service //启动数据库服务

# systemctl stop mariadb.service //停止数据库服务

# systemctl status mariadb.service //查看数据库服务状态

# systemctl enable mariadb.service //设置开机自动启动数据库服务

mariadb安装后启动服务 , 数据库root用户是没有密码的 , 需要进行初始化并设置密码 , 配置如下:

# mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB

SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it we'll need the current

password for the root user. If you've just installed MariaDB 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...

推荐阅读