MAC MYSQL 配置记录

24 篇文章 0 订阅
23 篇文章 0 订阅

brew search mysql

brew install mysql

==> Downloading https://homebrew.bintray.com/bottles/mysql-8.0.17_1.mojave.bottle.tar.gz

==> Downloading from https://akamai.bintray.com/07/07c53f2a0373372d2f613d604b9c17aceedd1a3990a995fc14

######################################################################## 100.0%

==> Pouring mysql-8.0.17_1.mojave.bottle.tar.gz

==> Caveats

We've installed your MySQL database without a root password. To secure it run:

    mysql_secure_installation

 

MySQL is configured to only allow connections from localhost by default

 

To connect run:

    mysql -uroot

 

To have launchd start mysql now and restart at login:

  brew services start mysql

Or, if you don't want/need a background service you can just run:

  mysql.server start

==> Summary

?  /usr/local/Cellar/mysql/8.0.17_1: 284 files, 272.4MB

 

mysql.server start

Starting MySQL

........ SUCCESS! 

mysql -uroot

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 9

Server version: 8.0.17 Homebrew

Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its

affiliates. Other names may be trademarks of their respective

owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show databases;

+--------------------+

| Database           |

+--------------------+

| information_schema |

| mysql              |

| performance_schema |

| sys                |

+--------------------+

4 rows in set (0.01 sec)

 

mysql> use mysql;

Reading table information for completion of table and column names

You can turn off this feature to get a quicker startup with -A

 

Database changed

mysql> show tables;

+---------------------------+

| Tables_in_mysql           |

+---------------------------+

| columns_priv              |

| component                 |

| db                        |

。。。

| user                      |

+---------------------------+

33 rows in set (0.01 sec)

 

mysql> alter user 'root'@'localhost' identified by 'root';

Query OK, 0 rows affected (0.01 sec)

 

不能通过127.0.0.1链接。。。

 

参考:

mysql 安装了最新版本8.x版本后的报错: the server requested authentication method unknown to the client

PHP错误:SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client

 


 

下面的方法后来我又删了使用上面的

 

brew install mysql@5.5

brew info mysql@5.5

mysql@5.5: stable 5.5.62 (bottled) [keg-only]

Open source relational database management system

https://dev.mysql.com/doc/refman/5.5/en/

/usr/local/Cellar/mysql@5.5/5.5.62 (320 files, 124.9MB)

  Poured from bottle on 2019-03-03 at 00:48:44

From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/mysql@5.5.rb

==> Dependencies

Build: cmake

Required: openssl

==> Caveats

A "/etc/my.cnf" from another install may interfere with a Homebrew-built

server starting up correctly.

 

MySQL is configured to only allow connections from localhost by default

 

To connect:

    /usr/local/opt/mysql@5.5/bin/mysql -uroot

 

mysql@5.5 is keg-only, which means it was not symlinked into /usr/local,

because this is an alternate version of another formula.

 

If you need to have mysql@5.5 first in your PATH run:

  echo 'export PATH="/usr/local/opt/mysql@5.5/bin:$PATH"' >> ~/.bash_profile

 

For compilers to find mysql@5.5 you may need to set:

  export LDFLAGS="-L/usr/local/opt/mysql@5.5/lib"

  export CPPFLAGS="-I/usr/local/opt/mysql@5.5/include"

 

 

To have launchd start mysql@5.5 now and restart at login:

  brew services start mysql@5.5

Or, if you don't want/need a background service you can just run:

  /usr/local/opt/mysql@5.5/bin/mysql.server start

 

 

source ~/.bash_profile

 

未完待续。。。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值