mysql有关配置

mysql安装

  1. mysql安装方式有三种
  • 源代码:编译安装
  • 二进制格式的程序包:展开至特定路径,并经过简单配置后即可使用
  • 程序包管理器管理的程序包:
    • rpm:有两种

      • OS Vendor:操作系统发行商提供的
      • 项目官方提供的
    • deb

MySQL配置

#启动mysql并设置开机自动启动
systemctl enable --now mariadb
systemctl status mariadb #确保3306端口已经监听起来
ss -antl #在日志文件中找出临时密码
grep "password" /var/log/mysqld.log #使用获取到的临时密码登录mysql
[root@localhost ~]# mysql -uroot -p
Enter password: //此处输入密码,可以直接复制你的密码粘贴至此处,也可手动输入
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.23 Copyright (c) 2000, 2018, 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> //看到有这样的标识符则表示成功登录了

修改密码

[root@localhost ~]# mysql                   #默认是没有密码的,直接回车即可登入
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 2
Server version: 5.5.68-MariaDB MariaDB Server Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> set password = password('123456'); #设置密码
Query OK, 0 rows affected (0.00 sec) //修改mysql登录密码
mysql> set global validate_password_policy=0;
Query OK, 0 rows affected (0.00 sec) mysql> set global validate_password_length=1;
Query OK, 0 rows affected (0.01 sec) mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'wangqing123!';
Query OK, 0 rows affected (0.00 sec) mysql> quit
Bye

最新文章

  1. WebApi系列~基于单请求封装多请求的设计~请求的安全性设计与实现
  2. asp.net判断FileUpload选择的文件是否是图片
  3. poj2632 Crashing Robots
  4. 【Spring】Spring的定时任务
  5. 通过JavaScript脚本实现验证码自动输入
  6. 导航(NavanavigationController)push和pop
  7. C#使用SqlDataReader读取数据库数据时CommandBehavior.CloseConnection参数的作用
  8. Java RESTful Web Service相关概念
  9. Linux转发性能评估与优化-转发瓶颈分析与解决方式(补遗)
  10. 浅谈PHP在各系统平台下的换行符
  11. java虚拟机学习-JVM调优总结-新一代的垃圾回收算法(11)
  12. 201521123096《Java程序设计》第十三周学习总结
  13. ●POJ 1269 Intersecting Lines
  14. DataTable转换成List集合,传递到HTML页面
  15. [2017BUAA软工助教]个人项目小结
  16. label与input之间的对应
  17. bat处理打开关闭exe
  18. 谷歌开源的TensorFlow Object Detection API视频物体识别系统实现(二)[超详细教程] ubuntu16.04版本
  19. SPI Flash Memory 芯片手册阅读
  20. (转)C# Oracle数据库操作类

热门文章

  1. 生产环境中mysql数据库由主从关系切换为主主关系
  2. flexbox(弹性盒布局模型),以及适用场景
  3. PhpStorm/WebStorm实用技巧
  4. Go 包管理与依赖查找顺序
  5. java面试一日一题:讲下在什么情况下会发生类加载
  6. 数据结构之队列(JavaScript描述)
  7. sklearn.metrics【指标】
  8. 记一次 .NET医疗布草API程序 内存暴涨分析
  9. 09- monkey命令详解
  10. Vue学习(二)-Vue中组件间传值常用的几种方式