范文健康探索娱乐情感热点
投稿投诉
热点动态
科技财经
情感日志
励志美文
娱乐时尚
游戏搞笑
探索旅游
历史星座
健康养生
美丽育儿
范文作文
教案论文
国学影视

通过brew来安装mysql

  通过brew来安装mysql:
  使用命令查询下brew所支持的版本:> brew search mysql
  选择mysql@5.7版本,比较稳定:> brew install mysql@5.7
  执行成功后,返回提示信息: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  mysql@5.7 is keg-only, which means it was not symlinked into /opt/homebrew, because this is an alternate version of another formula.  If you need to have mysql@5.7 first in your PATH, run:   echo "export PATH="/opt/homebrew/opt/mysql@5.7/bin:$PATH"" >> ~/.zshrc  For compilers to find mysql@5.7 you may need to set:   export LDFLAGS="-L/opt/homebrew/opt/mysql@5.7/lib"   export CPPFLAGS="-I/opt/homebrew/opt/mysql@5.7/include"  For pkg-config to find mysql@5.7 you may need to set:   export PKG_CONFIG_PATH="/opt/homebrew/opt/mysql@5.7/lib/pkgconfig"   To restart mysql@5.7 after an upgrade:   brew services restart mysql@5.7 Or, if you don"t want/need a background service you can just run:   /opt/homebrew/opt/mysql@5.7/bin/mysqld_safe --datadir=/opt/homebrew/var/mysql ==> Summary   /opt/homebrew/Cellar/mysql@5.7/5.7.41: 321 files, 232.8MB ==> Running `brew cleanup mysql@5.7`... Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP. Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
  默认是没有密码,需要通过「mysql_secure_installation」来设置密码,
  第一次安装,直接执行会提示错误:❯ mariadb-secure-installation zsh: command not found: mariadb-secure-installation
  需要配置路径,在上面的返回信息中已经提示了,依次执行这几个echo就可以了:If you need to have mysql@5.7 first in your PATH, run:   echo "export PATH="/opt/homebrew/opt/mysql@5.7/bin:$PATH"" >> ~/.zshrc  For compilers to find mysql@5.7 you may need to set:   export LDFLAGS="-L/opt/homebrew/opt/mysql@5.7/lib"   export CPPFLAGS="-I/opt/homebrew/opt/mysql@5.7/include"  For pkg-config to find mysql@5.7 you may need to set:   export PKG_CONFIG_PATH="/opt/homebrew/opt/mysql@5.7/lib/pkgconfig"
  设置完成后,重新加载配置,执行> source ~/.zshrc
  先要启动数据库服务:> mysql.server start
  然后在重新设置密码:> mariadb-secure-installation
  出现提示信息,并且选择对应配置:Securing the MySQL server deployment.   Connecting to MySQL using a blank password.   VALIDATE PASSWORD PLUGIN can be used to test passwords and improve security. It checks the strength of password and allows the users to set only those passwords which are secure enough. Would you like to setup VALIDATE PASSWORD plugin?  // 密码长度y 是8位以上 n 可以是6位 Press y|Y for Yes, any other key for No: n    Please set the password for root here. New password:            // 新密码 Re-enter new password:     // 确认密码 By default, a MySQL installation has an anonymous user, allowing anyone to log into MySQL without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment.  // 删除不用密码的账户 Remove anonymous users? (Press y|Y for Yes, any other key for No) : y   Success. Normally, root should only be allowed to connect from "localhost". This ensures that someone cannot guess at the root password from the network.  //是否禁止远程登录 Disallow root login remotely? (Press y|Y for Yes, any other key for No) : n  ... skipping. By default, MySQL comes with a database named "test" that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment.  // 是否删除test库 Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y  - Dropping test database... Success.  - Removing privileges on test database... Success. Reloading the privilege tables will ensure that all changes made so far will take effect immediately. Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y Success. All done!
  成功~
  如果在密码设置规则中选择错误,可以直接进入mysql修改:
  登陆mysql> mysql -u root
  先查看当前的密码验证规则:mysql> SHOW VARIABLES LIKE "validate_password%";
  选项
  默认值
  参数描述
  validate_password_check_user_name
  ON
  设置为ON的时候表示能将密码设置成当前用户名。
  validate_password_length
  8
  密码的最小长度,也就是说密码长度必须大于或等于8   validate_password_mixed_case_count   1
  如果密码策略是中等或更强的,validate_password要求密码具有的小写和大写字符的最小数量。对于给定的这个值密码必须有那么多小写字符和那么多大写字符。   validate_password_number_count   1
  密码必须包含的数字个数   validate_password_policy   MEDIUM   密码强度检验等级,可以使用数值0、1、2或相应的符号值LOW、MEDIUM、STRONG来指定。0/LOW:只检查长度。1/MEDIUM:检查长度、数字、大小写、特殊字符。2/STRONG:检查长度、数字、大小写、特殊字符、字典文件。   validate_password_special_char_count   1
  密码必须包含的特殊字符个数   可以通过语句直接修改对应选项:mysql> set GLOBAL validate_password_length=4;   完工了~

老戏骨张洪杰三亚养老,与妻子相伴坐游艇,77岁白发苍苍身体硬朗饿了吗?戳右边关注我们,每天给您送上最新出炉的娱乐硬核大餐!10月29日,有网友在社交平台上分享张洪杰的近况,晒出了他与妻子一起在三亚的养老生活,此事引发了网友热议。晒出的视频中,楼市风向转变,房价要触底反弹?央媒发声定调,无房人放心了前段时间和一个在开发商做品牌的朋友聊天,想了解下当下房地产行业的真实现状,房企们的生存状况是否真的入外界传的那样,已经发不了工资,开始裁员摆烂了。结果朋友告诉我,外界传的情况可能有浙江VS广东,依靠马尚裁判赢得比赛?还好我们有胡明轩头条创作挑战赛逆转罚球不中绝杀反绝杀?马尚最后一节的个人能力的确太强了,关键时刻三分不手软,突破无解的确厉害,易建联也证明自己尚能战斗广东队第三节后半段开始的131联防也的确把浙江机构详解香港联交所特专科技公司上市新规头部机构话语权大增利好硬科技及创投产业见习记者雨田日前,香港联合交易所有限公司(以下简称联交所)刊发特专科技公司上市制度咨询文件(以下简称咨询文件),征求公众意见及反馈,为期两个月。咨询文件提议修订上市规则,引入第18王毅同美国国务卿布林肯通电话2022年10月31日,中共中央政治局委员国务委员兼外长王毅应约同美国国务卿布林肯通电话,就当前及今后一段的中美关系交换了意见。布林肯表示美方密切关注中共二十大和大会报告。王毅表示英国一群小马在马路中央散步司机无奈停车让路据英国都市报报道,有一群淘气的小马在英国的新森林地区繁忙的道路中间四处乱窜,让路过的司机们很是困扰。因为这些动物们在新森林地区的所有道路上有先行权。有图片显示,这群看起来毛茸茸的小美国31年前的科技之战,彻底打醒了全世界要说现如今,中国之所以变得如此强大,有美国一份功劳,大家相信吗?别不信,如今中国军事与日俱增,多亏美国在中东发动的一场战争,这场战争不仅让我们的军队,有了迅猛的发展,同时也避免一场大量高端人才离开,美国正被釜底抽薪沈向洋是美国科技界的泰山级人物,主要专注于计算机视觉图形学人机交互统计学习模式识别和机器人等方向的研究工作,是计算机视觉和图形学研究的世界级专家他在1996年就进入了微软公司,离开随着势头的增加,比特币和以太币走高在过去24个小时里,比特币的价格上涨了大概0。3左右,这是最近一段时间以来最新的一次上涨,按市值计算的最大加密货币的价值上涨了约8。这一飙升是在人们对美联储能够在明年初某个时候缩减喜闻乐见丨凭什么是Python,而不是PxthonPython是当下最流行的编程语言之一,已经连续两年被TIOBE排行榜评为最热门的语言,如今依旧蝉联TIOBE月度排行榜的第一。当我们还在争辩哪个编程语言才是最好的语言的时候,已经(新华全媒)科技育种路追梦不止步近年来,中科院合肥研究院智能所离子束生物工程与绿色农业研究中心持续开展水稻种质创新基因发掘以及新材料应用等工作。围绕作物生产中迫切需要解决的难题,该研究中心利用离子束诱变技术发掘出