数据库

Docker运行Redis

79 words
安装 Docker Ubuntu安装Docker 运行redis Start a container for Redis with given port 6379: docker run -d --name redis-test -p 6379:6379 redis:latest 进入redis容器 For enter to container console and access redis, and kind in the console: docker exec -it redis-test bash [email protected]:/data# redis-cli

Sql Snippets

388 words
show tables SHOW TABLES command provides you with an option that allows you to filter the returned tables using the LIKE operator or an expression in the WHERE clause as follows: SHOW TABLES LIKE pattern; SHOW TABLES WHERE expression; 添加权限 mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root'; Query OK, 0 rows affected (0.27 sec) mysql> FLUSH PRIVILEGES; Query OK, 0 rows affected (0.25

Docker运行MySQL

765 words
下面记录一下Docker部署MySQL的步骤。 安装 Docker Ubuntu安装Docker docker pull - 下载镜像 Downloading the server image in a separate step is not strictly necessary; however, performing this step before you create your Docker container ensures

Ubuntu下安装配置MySQL

569 words
安装MySQL sudo apt update sudo apt-get install mysql-server //服务端 sudo apt-get install mysql-client //客户端 sudo apt-get install libmysqlclient-dev //程序编译时链接的库 服务启动后端口查询 sudo netstat -anp | grep mysql tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 1733875/mysqld tcp 0 0 127.0.0.1:33060 0.0.0.0:*

Django数据库连接池

4025 words
数据库长连接 长连接是指程序之间的连接在建立之后,就一直打开,被后续程序重用。使用长连接的初衷是减少连接的开销。 先看看官方文档是怎么讲Djan

MySQL优化思路-后端

2123 words
基本思路 首先是如何定位性能瓶颈? 一般使用show命令、慢查询日志、explain、profiling等进行分析。 打印慢查询日志,找出执行慢的