应用系统基础服务安装

来自CloudWiki
Cloud17讨论 | 贡献2019年10月22日 (二) 08:50的版本 (创建页面,内容为“ == '''数据库配置:(考试的重点)''' == <nowiki># # This group is read both both by the client and the server # use it for options that affect everyt…”)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳转至: 导航搜索

数据库配置:(考试的重点)

#
# This group is read both both by the client and the server
# use it for options that affect everything
#
[client-server]

#
# include all files from the config directory
#
!includedir /etc/my.cnf.d
[mysqld]

init_connect='SET collation_connection=utf8_unicode_ci'
init_connect='SET NAMES utf8'
character-set-server=utf8
collation-server=utf8_unicode_ci
skip-character-set-client-handshake

数据库密码:

 Mysqladmin –uroot –p123456(密码必须是这个,暂时)


[root@localhost bin]# systemctl start mariadb

[root@localhost bin]# mysqladmin -uroot password 123456

[root@localhost bin]# mysql -uroot -p123456

设置用户权限:

MariaDB [(none)]> grant all privileges on *.* to root@localhost identified by '123456' with grant option; Query OK, 0 rows affected (0.000 sec)

MariaDB [(none)]> grant all privileges on *.* to root@'%' identified by '123456' with grant option;Query OK, 0 rows affected (0.000 sec)

上传文件:

MariaDB [(none)]> create database gpmall; Query OK, 1 row affected (0.001 sec)

MariaDB [(none)]> use gpmall; Database changed MariaDB [gpmall]> source /opt/gpmall/gpmall-file ERROR: Can't initialize batch_readline MariaDB [gpmall]> source /opt/gpmall/gpmall-file/gpmall.sql

退出数据库并开机自启: MariaDB [gpmall]> Ctrl-C -- exit! Aborted [root@localhost bin]# systemctl enable mariadb


启动Redis

vi /etc/redis.conf

 #bind 127.0.0.1
  protected-mode no


[root@localhost bin]# systemctl start redis

[root@localhost bin]# systemctl enable redis

Created symlink from /etc/systemd/system/multi-user.target.wants/redis.service to /usr/lib/systemd/system/redis.service.

配置ElasticSearch

暂时不做

配置nginx

[root@localhost bin]# systemctl start nginx

[root@localhost bin]# systemctl enable nginx

Created symlink from /etc/systemd/system/multi-user.target.wants/nginx.service to /usr/lib/systemd/system/nginx.service.