CentOS7安装Apache+PHP+MariaDB
2015-09-18 20:07
781 查看
首先,安装Apache服务器
第二,安装PHP及常用软件包
第三,安装MariaDB
第四,启动服务
第五,如果第四部成功,则设置两个服务自动启动
第六,设置数据库服务器
yum install httpd
第二,安装PHP及常用软件包
yum install php httpd-manual mod_ssl mod_perl mod_auth_mysql yum install php-gd php-xml php-mbstring php-ldap php-pear php-xmlrpc yum install mysql-connector-odbc mysql-devel libdbi-dbd-mysql
第三,安装MariaDB
yum install mariadb*
第四,启动服务
systemctl start httpd.service systemctl start mariadb.service
第五,如果第四部成功,则设置两个服务自动启动
systemctl enable httpd.service systemctl enable mariadb.service
第六,设置数据库服务器
[root@rachel ~]# mysql -u root #无密码登录数据库 Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 3 Server version: 5.5.44-MariaDB MariaDB Server Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> select user, host, password from mysql.user; #检索数据库用户 +------+--------------+----------+ | user | host | password | +------+--------------+----------+ | root | localhost | | | root | rachel | | | root | 127.0.0.1 | | | root | ::1 | | | | localhost | | | | rachel | | +------+--------------+----------+ 6 rows in set (0.00 sec) MariaDB [(none)]> delete from mysql.user where user=''; Query OK, 2 rows affected (0.00 sec) #删除匿名用户 MariaDB [(none)]> delete from mysql.user where user='root' and host='::1'; #删除IPv6方式登录用户 Query OK, 1 row affected (0.00 sec) MariaDB [(none)]> select user, host, password from mysql.user; #再次查看用户 +------+--------------+----------+ | user | host | password | +------+--------------+----------+ | root | localhost | | | root | rachel | | | root | 127.0.0.1 | | +------+--------------+----------+ 3 rows in set (0.00 sec) MariaDB [(none)]> set password for root@localhost=password('XXXXXX'); #修改本地登录密码 Query OK, 0 rows affected (0.00 sec) MariaDB [(none)]> set password for root@rachel=password('XXXXXX'); #修改本地登录密码 Query OK, 0 rows affected (0.00 sec) MariaDB [(none)]> set password for root@'127.0.0.1'=password('XXXXXX'); #修改本地登录密码 Query OK, 0 rows affected (0.00 sec) MariaDB [(none)]> select user, host, password from mysql.user; #查看密码 +------+--------------+-------------------------------------------+ | user | host | password | +------+--------------+-------------------------------------------+ | root | localhost | *1728FCC102D8D1EB12BFXXXXXXXXXXXXXXXXXXX | | root | rachel | *1728FCC102D8D1EB12BFXXXXXXXXXXXXXXXXXXX | | root | 127.0.0.1 | *1728FCC102D8D1EB12BFXXXXXXXXXXXXXXXXXXX | +------+--------------+-------------------------------------------+ 3 rows in set (0.00 sec) MariaDB [(none)]> exit #退出 Bye [root@rachel ~]# mysql -u root -p #再次用密码登录测试 Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 4 Server version: 5.5.44-MariaDB MariaDB Server Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> exit Bye [root@rachel ~]# #测试成功
相关文章推荐
- CentOS安装和设置MariaDB的教程
- 详解Centos 使用YUM安装MariaDB
- centos 7安装mysql5.5和安装 mariadb使用的命令
- 浅谈MySQL和mariadb区别
- Mysql/MariaDB启动时处于进度条状态导致启动失败的原因及解决办法
- 【阿里ECS】【01】centOS 7 mariaDB(Mysql)安装,并更改密码,开启远程连接
- centos 7 卸载 mariadb 的正确命令
- MariaDb数据库管理系统的学习(一)安装示意图
- MariaDB 10.0.X中,动态列支持 JSON 格式来获取数据。
- CentOS6.5安装 MariaDB Galera Cluster 10.0
- MySQL、MariaDB修改默认字符集
- 总结一下,MariaDB 10(MySQL5.6企业版分支)的主要新特性
- mysql/mariadb性能调优的15个技巧
- mariadb-2
- mariadb-1
- 【未完】mariadb数据库安装,修改数据库路径
- 安装mariadb并且建立用户组和新的用户
- MariaDB数据库在Linux下的编译安装配置
- Linux下源码安装mariadb
- [部署]CentOS安装MariaDB