MacOS 安装MariaDB

1. 下载PKG链接

https://mariadb.com/downloads/#mariadb_platform-mariadb_server

选择下载的安装包

2. 安装流程参考视频

https://www.youtube.com/watch?v=dWPMkKGsLis

3. 完成上述步骤之后

  • 确定root用户没有密码但是还是登陆不了并且报错如下
ERROR 1698 (28000): Access denied for user 'root'@'localhost'
  • 查看官方文档:https://mariadb.com/kb/en/library/installing-mariadb-server-pkg-packages-on-macos/
    截取关键信息:

To log in to MariaDB as root, you will need to become root on the OS; the preferred mechanism for this is to use sudo, like this:
sudo /usr/local/mariadb/server/bin/mariadb

  • 执行该命令之后输入密码,这里的密码是电脑管理员的密码
以管理员身份登陆mariadb
  • 登陆成功后执行下列命令
// 使用mysql数据库
use mysql;
// 更改root用户的密码(这步可选)
update user set password=[你要设置的密码] where user = 'root';
// 打开远程访问权限 '123456' 是 root用户密码
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'IDENTIFIED BY '123456' WITH GRANT OPTION;
// 刷新权限
flush privileges;

你可能感兴趣的:(MacOS 安装MariaDB)