通过 homebrew 新装了 mariadb
然后通过 mysql -u root 登录用户后,发现无论执行什么命令都没有任何权限。
因为没有任何权限,所以执行的任何命令都是 access denied,网上搜了很多解决方案,对我都不适用,例如运行 mysql_secure_installation,或者 grant all on ...,或者登录修改 root 用户密码等等,因为没有任何操作权限,所以你对数据库的任何操作都不起作用。即使想 select * from mysql.user 想看看用户表的情况也是 access denied。
那么,我装这个数据库到底有什么用呢?
大神们用没有什么解决方案或者思路? windows 就没有这种问题,谁跟我说开发 Mac 好用的!!骗人骗人!
1
liprais 2018-09-27 20:22:43 +08:00
brew install 装完了以后有一大段说明你肯定没看
|
2
chuanqirenwu OP @liprais 看了的,还复制出来记录了
MySQL is configured to only allow connections from localhost by default To connect: mysql -uroot To have launchd start mariadb now and restart at login: brew services start mariadb Or, if you don't want/need a background service you can just run: mysql.server start ==> Summary 🍺 /usr/local/Cellar/mariadb/10.3.9: 651 files, 174.3MB |
3
evlos 2018-09-27 20:35:05 +08:00
mysql_install_db 看看
|
4
forrestshuang 2018-09-27 20:39:19 +08:00
docker 装,这年头本地下软件,很难受的
|
5
chuanqirenwu OP @evlos WARNING: The host 'YangdeMacBook-Pro.local' could not be looked up with /usr/local/Cellar/mariadb/10.3.9/bin/resolveip.
This probably means that your libc libraries are not 100 % compatible with this binary MariaDB version. The MariaDB daemon, mysqld, should work normally with the exception that host name resolving will not work. This means that you should use IP addresses instead of hostnames when specifying MariaDB privileges ! Installing MariaDB/MySQL system tables in '/usr/local/var/mysql' ... OK To start mysqld at boot time you have to copy support-files/mysql.server to the right place for your system PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER ! To do so, start the server, then issue the following commands: '/usr/local/Cellar/mariadb/10.3.9/bin/mysqladmin' -u root password 'new-password' '/usr/local/Cellar/mariadb/10.3.9/bin/mysqladmin' -u root -h YangdeMacBook-Pro.local password 'new-password' Alternatively you can run: '/usr/local/Cellar/mariadb/10.3.9/bin/mysql_secure_installation' which will also give you the option of removing the test databases and anonymous user created by default. This is strongly recommended for production servers. See the MariaDB Knowledgebase at http://mariadb.com/kb or the MySQL manual for more instructions. You can start the MariaDB daemon with: cd '/usr/local/Cellar/mariadb/10.3.9' ; /usr/local/Cellar/mariadb/10.3.9/bin/mysqld_safe --datadir='/usr/local/var/mysql' You can test the MariaDB daemon with mysql-test-run.pl cd '/usr/local/Cellar/mariadb/10.3.9/mysql-test' ; perl mysql-test-run.pl Please report any problems at http://mariadb.org/jira The latest information about MariaDB is available at http://mariadb.org/. You can find additional information about the MySQL part at: http://dev.mysql.com Consider joining MariaDB's strong and vibrant community: https://mariadb.org/get-involved/ 按照它的建议做了一些事,但好像依然没有效果 |
6
chuanqirenwu OP @forrestshuang 这个不是解决问题的方式吧,那终极解决方案就是换到 windows 了。
|
7
alvinbone88 2018-09-27 23:15:05 +08:00
https://mariadb.com/kb/en/library/connecting-to-mariadb/
The user name is either your Unix login name, or ODBC on Windows. |
8
alvinbone88 2018-09-27 23:32:22 +08:00
看错了,先把错误号贴上来
|
9
EvilCult 2018-09-27 23:49:40 +08:00 via iPhone
我一直认为终极的解决办法是………… Vagrant …………
|
10
Trim21 2018-09-28 00:33:01 +08:00 via Android
docker 装+1
|
11
GTim 2018-09-28 08:39:53 +08:00
根据第一段的描述,是因为 /usr/local/Cellar/mariadb/10.3.9/bin/resolveip 没法解析 localhost 这个域名
解决办法之一就是运行 /usr/local/Cellar/mariadb/10.3.9/bin/resolveip localhost 先正确解析下 |
12
chuanqirenwu OP @GTim 应该不是这个问题,重启 mac 解决了
|