美文网首页
Mac OS下brew安装mysql

Mac OS下brew安装mysql

作者: EmmaQin | 来源:发表于2018-10-12 16:27 被阅读0次

    1.安装

    brew install mysql

    2. 配置

    mysql服务设置为开机自动启动

    brew services start mysql

    关闭mysql服务

    brew services stop mysql

    重启mysql服务

    brew services restart mysql

    查看mysql服务状态

    brew services list

    3. 设置root密码

    mysql_secure_installation

    设置步骤
    a)为root用户设置密码

    b)删除匿名账号

    c)取消root用户远程登录

    d)删除test库和对test库的访问权限

    e)刷新授权表使修改生效

    4. navicat连接

    连接报错,执行如下命令

    ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '你的密码';

    SELECT plugin FROM mysql.user WHERE User = 'root';

    5. mysql导入数据报错

    错误:ERROR 2006 (HY000): MySQL server has gone away
    修改max_allowed_packet值

    show variables like 'max_allowed_packet';

    set global max_allowed_packet = 1048576000;

    相关文章

      网友评论

          本文标题:Mac OS下brew安装mysql

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