• Home
  • Archives
  • 随笔
所有文章 友链 关于我

  • Home
  • Archives
  • 随笔

Mysql学习笔记

发布于: 2018-08-05
更新于: 2023-07-09

mysql

install

windows

mysql installer can finish almost all of the things of configuring and installing. There have two programs should be noticed,MySQL Server which is the main application to deploy your database or something else. MySQL WorkBench is a program graphical to control your database, server etc. Remember when your configure the MySQL Server, the user should act the actual effects, such as Admin or Database manager.

connect

  • When u connect to the server.

create databese xxx; (ctrl+enter execute current line)

usage

  • create table for the database
create table `database's name`.`table's name`(
    command
)

TIPS

  • tips:when u write your page with idea,and indent the row too behind,it will be automaticaliy code snippet

  • FUNCTION和PROCEDURE,除了function只能返回一个函数外,其他基本一样

  • while和创建过程

  • repeat
repeat
    statement
until condition
end repeat
  • if-else
if condition then
    statement
else
    statement
end if

密码设置

忘记密码

  • 首先找到.cnf配置文件,有很多个,按优先次序寻找即可。

cnf照片

  • 然后打开cnf文件在里面添加以下代码
[mysqld]
skip-grant-tables

加入这段语句后执行/etc/init.d/mysql restart重启mysql服务后登陆mysql时将不需要密码,即执行mysql -u root -p然后回车即可登录

修改密码

执行以下语句更改密码update mysql.user set authentification_string=password('xxxxxx') where user='root' and host='localhost'

然后执行flush privileges即可更改密码

当更改完密码后记得将前面设置的内容删除,不然登录仍然是不用密码的

修改登录权限

赋予所有人登录权限,以root+密码的形式登录

grant all privileges on *.* to 'root'@'%' INDETIFIED BY 'password' WITH GRANT OPTION;
flush privileges;

sql

time_format()

参考这里

# 分钟是%i 具体规则上网百度吧 
select DATE_FORMAT(time_column,"%Y %m %d %h %i %s")
```<script src="https://cdnjs.cloudflare.com/ajax/libs/raphael/2.2.7/raphael.min.js"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/flowchart/1.6.5/flowchart.min.js"></script>
Mysql学习笔记
/archives/7f3b056/
作者
tyrantqiao
发布于
2018-08-05
更新于
2023-07-09
许可协议
CC BY-NC-SA 4.0
赏

蟹蟹大佬的打赏,大家一起进步

支付宝
微信
  • mysql

扫一扫,分享到微信

微信分享二维码
spring注入错误解决方案
python学习笔记
© 2024 tyrantqiao 本站总访问量次 本站访客数人次 载入天数...载入时分秒...
  • 所有文章
  • 友链
  • 关于我

tag:

  • 复盘
  • 我
  • 规划
  • java
  • 面试
  • 源码
  • 架构
  • Hadoop
  • HTTP
  • TCP
  • 学习笔记
  • IDEA
  • maven
  • idea
  • Java
  • jdk
  • 面经
  • linux
  • 爱情
  • mysql
  • 性能
  • sql
  • Mysql
  • JAVA
  • 技术
  • Redis
  • MQ
  • Spring
  • 数据库
  • TIDB
  • spring
  • unity
  • chatgpt
  • 经验分享
  • 前端
  • redis
  • vue
  • git
  • shadowsocks
  • hexo
  • blog
  • bug
  • 开发
  • 业务
  • jvm
  • 算法
  • MySQL
  • nginx
  • Linux
  • mq
  • db
  • springCloud
  • ssh
  • python
  • 爬虫
  • test
  • vim
  • 影视剧
  • 中间件
  • 事务
  • 性格
  • 音乐
  • 程序员
  • 随笔
  • mybatis
  • 演讲
  • 域名
  • 猫咪
  • 她
  • github
  • 计划
  • 旅游
  • 软件
  • 心理
  • 情商
  • 幽默
  • 才艺
  • 穿搭
  • 编程
  • 排序
  • 查找
  • 缓存
  • 网络
  • 设计模式
  • c
  • 课程设计
  • centos
  • 数学
  • 本网站主题yilia设计者的主页
如果有问题或者想讨论的可以联系[email protected]或者[email protected]