在kylin_v10系统下,学习mysql数据库时。发现系统下默认装了数据库。想要直接使用。在启动时报以下错误。

[root@localhost bin]# service mysql status
Redirecting to /bin/systemctl status mysql.service
Unit mysql.service could not be found.

[root@localhost bin]# systemctl start mysqld
Failed to start mysqld.service: Unit mysqld.service not found.

在网上找了一些解决方法,最后发现是在默认数据库中,安装的是MariaDB,需要先开启MariaDB服务,然后才可以直接使用 mysql 命令直接进入数据库。

命令如下:

systemctl start mariadb.service
systemctl enable mariadb.service
mysql_secure_installation

前两步是开启服务,第三步进入数据库前的设置(用户,密码设置),可以不设置。

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐