[Mac] 安装MariaDB 实战

2020-03-11  本文已影响0人  秋名山车神12138

正常安装流程

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/
上一篇 下一篇

猜你喜欢

热点阅读