mysql有关配置
2024-10-21 06:33:16
mysql有关配置
mysql安装
- mysql安装方式有三种
- 源代码:编译安装
- 二进制格式的程序包:展开至特定路径,并经过简单配置后即可使用
- 程序包管理器管理的程序包:
- rpm:有两种
- OS Vendor:操作系统发行商提供的
- 项目官方提供的
- deb
- rpm:有两种
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
最新文章
- WebApi系列~基于单请求封装多请求的设计~请求的安全性设计与实现
- asp.net判断FileUpload选择的文件是否是图片
- poj2632 Crashing Robots
- 【Spring】Spring的定时任务
- 通过JavaScript脚本实现验证码自动输入
- 导航(NavanavigationController)push和pop
- C#使用SqlDataReader读取数据库数据时CommandBehavior.CloseConnection参数的作用
- Java RESTful Web Service相关概念
- Linux转发性能评估与优化-转发瓶颈分析与解决方式(补遗)
- 浅谈PHP在各系统平台下的换行符
- java虚拟机学习-JVM调优总结-新一代的垃圾回收算法(11)
- 201521123096《Java程序设计》第十三周学习总结
- ●POJ 1269 Intersecting Lines
- DataTable转换成List集合,传递到HTML页面
- [2017BUAA软工助教]个人项目小结
- label与input之间的对应
- bat处理打开关闭exe
- 谷歌开源的TensorFlow Object Detection API视频物体识别系统实现(二)[超详细教程] ubuntu16.04版本
- SPI Flash Memory 芯片手册阅读
- (转)C# Oracle数据库操作类