环境
- 系统:Ubuntu 22.04
安装
1. 更新源
sudo apt-get update
2. 安装 MariaDB
sudo apt-get install mariadb-server
![](https://img.haomeiwen.com/i14245154/9c20485f81dd60c8.png)
3. 查看MeriaDB是否运行
service mysql status
![](https://img.haomeiwen.com/i14245154/7837c9d6a0ecc0ce.png)
● mariadb.service - MariaDB 10.6.16 database server
Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2024-03-20 04:50:53 UTC; 1 day 20h ago
Docs: man:mariadbd(8)
https://mariadb.com/kb/en/library/systemd/
Tasks: 52 (limit: 38144)
Memory: 19.4G
CPU: 1h 18min 50.473s
CGroup: /system.slice/mysqld.service
├─52827 /bin/sh /usr/local/mysql/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/cfl.pid
└─52977 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/var/lib/mysql --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql ->
root@cfl:/home/cfl# vim /etc/mysql/mariadb.conf.d/50-server.cnf
root@cfl:/home/cfl# sudo service mysql restart
Job for mariadb.service failed because the control process exited with error code.
See "systemctl status mariadb.service" and "journalctl -xeu mariadb.service" for details.
root@cfl:/home/cfl# sudo service mysql restart
Job for mariadb.service failed because the control process exited with error code.
See "systemctl status mariadb.service" and "journalctl -xeu mariadb.service" for details.
按 q
退出
远程连接
1. 修改配置文件:/etc/mysql/mariadb.conf.d/50-server.cnf
![](https://img.haomeiwen.com/i14245154/f6b0dcdf40a0b861.png)
bind-address = 0.0.0.0
skip-networking=0
![](https://img.haomeiwen.com/i14245154/c2f330104279d8c7.png)
安装完导致我原来的mysql 也起不来了
sudo apt-get remove --purge mariadb-server mariadb-client
sudo apt-get autoremove
sudo apt-get update
网友评论