所以......可能我是个白痴,但我被卡住了。我刚刚在 Digial Ocean 上设置了 CentOS 7,但似乎无法运行 MariaDB/MySQL 服务器。
一些输出
[root@hostname ~]# yum list installed |grep maria
mariadb.x86_64 1:5.5.37-1.el7_0 @updates
mariadb-libs.x86_64 1:5.5.37-1.el7_0 @updates
mariadb-server.x86_64 1:5.5.37-1.el7_0 @updates
Run Code Online (Sandbox Code Playgroud)
这样就安装好了,我们至少可以看到客户端吗?
[root@hostname ~]# which mysql
/bin/mysql
Run Code Online (Sandbox Code Playgroud)
让我们尝试启动服务器,只是为了好玩
[root@hostname ~]# service mysqld start
Redirecting to /bin/systemctl start mysqld.service
Failed to issue method call: Unit mysqld.service failed to load: No such file or directory.
[root@hostname ~]# mysqld
-bash: mysqld: command not found
[root@hostname ~]# mysql.server start
-bash: mysql.server: command not found
[root@hostname ~]#
Run Code Online (Sandbox Code Playgroud)
这就是我迷路的地方。查看实际安装的内容,没有服务器/守护程序
[root@hostname ~]# ls …
Run Code Online (Sandbox Code Playgroud) 我有一台 Centos 7 服务器。
删除了以前的 MariaDb 5.5 并在https://mariadb.com/kb/en/mariadb/yum/ 之后安装了 MariaDb 10
添加了 MariaDB YUM 存储库,然后执行:
sudo yum install MariaDB-server MariaDB-client
Run Code Online (Sandbox Code Playgroud)
一切都很好,然后当我尝试运行时:
sudo systemctl start mariadb
Run Code Online (Sandbox Code Playgroud)
我得到:
Failed to start mariadb.service: Unit mariadb.service failed to load: No such file or directory.
Run Code Online (Sandbox Code Playgroud)
但是,如果我运行:
sudo systemctl start mysql
Run Code Online (Sandbox Code Playgroud)
工作并启动 MariaDb。在另一台服务器上,我可以通过调用 MariaDb 而不是 MySql 来启动 MariaDb,就像在这个实例上一样。我觉得这有点烦人。多次删除 MariaDb,rm -r /var/lib/mysql* 但无济于事。
服务器一工作:
[root@phos bod]# rpm --query centos-release
centos-release-7-2.1511.el7.centos.2.10.x86_64
[root@phos bod]# systemctl start mariadb.service
[root@phos bod]#
Run Code Online (Sandbox Code Playgroud)
服务器二(相同的操作系统和相同版本的 MariaDB)不起作用:
[root@carpo bod]# rpm --query centos-release
centos-release-7-2.1511.el7.centos.2.10.x86_64 …
Run Code Online (Sandbox Code Playgroud)