首页   注册   登录
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
MySQL 5.5 Community Server
MySQL 5.6 Community Server
Percona Configuration Wizard
XtraBackup 搭建主从复制
Great Sites on MySQL
Percona
MySQL Performance Blog
Severalnines
推荐管理工具
Sequel Pro
phpMyAdmin
推荐书目
MySQL Cookbook
MySQL 相关项目
MariaDB
Drizzle
参考文档
http://mysql-python.sourceforge.net/MySQLdb.html
拉钩
V2EX  ›  MySQL

Mac 新装 mariadb 后 root 用户登录无任何权限

  •  
  •   chuanqirenwu · 78 天前 · 932 次点击
    这是一个创建于 78 天前的主题,其中的信息可能已经有所发展或是发生改变。

    通过 homebrew 新装了 mariadb

    然后通过 mysql -u root 登录用户后,发现无论执行什么命令都没有任何权限。

    因为没有任何权限,所以执行的任何命令都是 access denied,网上搜了很多解决方案,对我都不适用,例如运行 mysql_secure_installation,或者 grant all on ...,或者登录修改 root 用户密码等等,因为没有任何操作权限,所以你对数据库的任何操作都不起作用。即使想 select * from mysql.user 想看看用户表的情况也是 access denied。

    那么,我装这个数据库到底有什么用呢?

    大神们用没有什么解决方案或者思路? windows 就没有这种问题,谁跟我说开发 Mac 好用的!!骗人骗人!

    第 1 条附言  ·  78 天前
    好吧!我解决了,解决方式特别简单,重新启动 Mac OS !!!
    12 回复  |  直到 2018-09-28 08:56:20 +08:00
        1
    liprais   78 天前
    brew install 装完了以后有一大段说明你肯定没看
        2
    chuanqirenwu   78 天前
    @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   78 天前
    mysql_install_db 看看
        4
    forrestshuang   78 天前
    docker 装,这年头本地下软件,很难受的
        5
    chuanqirenwu   78 天前
    @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   78 天前
    @forrestshuang 这个不是解决问题的方式吧,那终极解决方案就是换到 windows 了。
        7
    alvinbone88   78 天前
    https://mariadb.com/kb/en/library/connecting-to-mariadb/
    The user name is either your Unix login name, or ODBC on Windows.
        8
    alvinbone88   78 天前
    看错了,先把错误号贴上来
        9
    EvilCult   78 天前 via iPhone
    我一直认为终极的解决办法是………… Vagrant …………
        10
    Trim21   78 天前 via Android
    docker 装+1
        11
    GTim   78 天前
    根据第一段的描述,是因为 /usr/local/Cellar/mariadb/10.3.9/bin/resolveip 没法解析 localhost 这个域名

    解决办法之一就是运行 /usr/local/Cellar/mariadb/10.3.9/bin/resolveip localhost 先正确解析下
        12
    chuanqirenwu   78 天前
    @GTim 应该不是这个问题,重启 mac 解决了
    关于   ·   FAQ   ·   API   ·   我们的愿景   ·   广告投放   ·   感谢   ·   实用小工具   ·   2207 人在线   最高记录 4019   ·  
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.1 · 17ms · UTC 09:58 · PVG 17:58 · LAX 01:58 · JFK 04:58
    ♥ Do have faith in what you're doing.
    沪ICP备16043287号-1