问题原文
原帖链接 · Oliver Williams · CC BY-SA 3.0
I set up a Digital Ocean droplet (server) a few days ago and need to access mysql. No password for root is working amongst what I've tried. However this command:
service mysql[d] stop
Doesn't work. Apparently I am supposed to issue this command:
sudo systemctl stop mariadb.service
But that results in
Failed to stop mariadb.service: Unit mariadb.service not loaded.
Furthermore, this command
mysqld_safe --skip-grant-tables --skip-networking & mysql -u root
Results in these responses:
sudo: mysqld_safe: command not found
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
[1]+ Exit 1 sudo mysqld_safe --skip-grant-tables --skip-networking
I am logged into the server as root; what do I do from here?
社区高分解答
原帖链接 · Anthony Fornito · CC BY-SA 3.0
Try
yum remove mysql
Then try
service mariadb restart
Then look at the out from
service mariadb status
You should see it running then the commands your tried early should work
if
yum remove mysql
does not work Try
chkconfig mysql off
Reboot and try to start maria again.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
