嘟嘟社区

[疑问] 甲骨文如何用一个实例放数据库?


甲骨文两个实例,想一个用来建站一个用来放MySQL 数据库。但之前我只会宝塔的傻瓜式操作,把数据库和网站装在一起,没有自己装过数据库。在数据库的小鸡上我要怎么单独安装MySQL ?然后怎么能够让数据库走甲骨文内网连接到建站小鸡?
centos7+复制粘贴, 配置都给你搞好了,自己添加一个%用户就行了
  1. cat << EOF > /etc/yum.repos.d/MariaDB.repo
  2. [mariadb]
  3. name = MariaDB
  4. #baseurl =  http://yum.mariadb.org/10.3/centos7-amd64
  5. #gpgkey= https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
  6. baseurl =  http://mirrors.ustc.edu.cn/mariadb/yum/10.7/centos7-amd64/
  7. gpgkey= http://mirrors.ustc.edu.cn/mariadb/yum/RPM-GPG-KEY-MariaDB
  8. gpgcheck=1
  9. EOF
  10. yum -y install mariadb mariadb-server
  11. cat << EOF > /etc/my.cnf.d/server.cnf
  12. #
  13. # These groups are read by MariaDB server.
  14. # Use it for options that only the server (but not clients) should see
  15. #
  16. # See the examples of server my.cnf files in /usr/share/mysql/
  17. #
  18. # this is read by the standalone daemon and embedded servers
  19. [server]
  20. # this is only for the mysqld standalone daemon
  21. [mysqld]
  22. character-set-server    = utf8mb4
  23. innodb_large_prefix     = on
  24. lower_case_table_names  = 1
  25. #
  26. # * Galera-related settings
  27. #
  28. [galera]
  29. # Mandatory settings
  30. #wsrep_on=ON
  31. #wsrep_provider=
  32. #wsrep_cluster_address=
  33. #binlog_format=row
  34. #default_storage_engine=InnoDB
  35. #innodb_autoinc_lock_mode=2
  36. #
  37. # Allow server to accept connections on all interfaces.
  38. #
  39. #bind-address=0.0.0.0
  40. #
  41. # Optional setting
  42. #wsrep_slave_threads=1
  43. #innodb_flush_log_at_trx_commit=0
  44. # this is only for embedded server
  45. [embedded]
  46. # This group is only read by MariaDB servers, not by MySQL.
  47. # If you use the same .cnf file for MySQL and MariaDB,
  48. # you can put MariaDB-only options here
  49. [mariadb]
  50. # This group is only read by MariaDB-10.7 servers.
  51. # If you use the same .cnf file for MariaDB of different versions,
  52. # use this group for options that older servers don’t understand
  53. [mariadb-10.7]
  54. EOF
  55. systemctl enable –now mysql

复制代码

同样安装个宝塔面板   然后单独装mysql就行了
单独安mysql, 用外网连接呗

robot 发表于 2021-12-4 11:42
单独安mysql, 用外网连接呗

能不能走甲骨文内网?就是数据库地址填写10.0.0.xx那个内网地址

这个主意不错啊.

apt-get install mysql

scheme 发表于 2021-12-4 11:49
这个主意不错啊.

apt-get install mysql

这样安装完就好啦?不用再设置啥了吗?

同地区内网应该行,不过同一地区用外网延迟也就一点点,没影响
只会用宝塔,还是用甲骨文,没必要折腾什么站库分离。

CMBCHINA 发表于 2021-12-4 11:55
centos7+复制粘贴, 配置都给你搞好了,自己添加一个%用户就行了

哇,感谢感谢