美文网首页
[Mac] 安装MariaDB 实战

[Mac] 安装MariaDB 实战

作者: 秋名山车神12138 | 来源:发表于2020-03-11 10:56 被阅读0次

正常安装流程

1. 下载安装
brew install mariadb

2. 执行安全的安装脚本
mysql_secure_installation
  1. 创建drupal数据库
$ mysqladmin -u root -p create drupal
Enter password: 
$ mysql -u root -p
Enter password: zoinks
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 15 to server version: 4.1.11-standard

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> GRANT ALL PRIVILEGES ON drupal.* TO drupaldbuser@localhost IDENTIFIED BY 'fuffy';
Query OK, 0 rows affected (0.04 sec)

mysql> SET PASSWORD FOR 'drupaldbuser'@'localhost' = OLD_PASSWORD('fuffy');
Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.19 sec)
mysql> \q
Bye

可能出现的问题

  1. root账号被默认设置,需要修改mariadb或是mysql的root账号?
    一般报的错位Access Denied ,想要修改的话可以在root权限下执行mysql_secure_installation命令
    https://www.osradar.com/reset-the-mysql-mariadb-root-password/

相关文章

网友评论

      本文标题:[Mac] 安装MariaDB 实战

      本文链接:https://www.haomeiwen.com/subject/luhqjhtx.html