安装 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
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的步骤。 安装 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
安装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:*
数据库长连接 长连接是指程序之间的连接在建立之后,就一直打开,被后续程序重用。使用长连接的初衷是减少连接的开销。 先看看官方文档是怎么讲Djan
为了解决单个数据库的性能问题,除了使用性能更好的硬件之外, 另外一个思路就是将一个数据库切分成多个部分放到不同的数据库上,从而缓解单一数据库的
基本思路 首先是如何定位性能瓶颈? 一般使用show命令、慢查询日志、explain、profiling等进行分析。 打印慢查询日志,找出执行慢的