打算把最近用Django写的API放在研究室的服务器上。于是先打算在服务器上把数据库配置好。
我使用的是Mariadb,服务器上之前就有前辈安装好了。
1.开启服务
[jyou@server1 root]$ systemctl start mariadb
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to manage system services or units.
Authenticating as: seike
Password: Failed to start mariadb.service
这里莫名其妙一开启服务就自动进入学长的设置里,要输入他的密码
查询了一下,必须得先切换成root用户才行
[jyou@server1 smartagri]$ su root
password:
[root@server1 smartagri]# systemctl start mariadb
[root@server1 smartagri]#
这就顺利开启服务了
2.进入数据库
现在的Mariadb是默认root用户无密码的,所以也不用输入密码就能进入
[root@server1 smartagri]# mysql -uroot -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id