MySQL性能优化

{% img /images/mysql.jpg %} 环境搭建 Vagrant + VirtualBox Vagrant: https://www.vagrantup.com/ VirtualBox: https://www.virtualbox.org/ Ubuntu16安装mysql57 更换阿里源 wget -O install.sh https://gitee.com/hsowan/ausi/raw/master/install.sh && sudo bash install.sh xenial 安装mysql57 sudo apt install mysql-server mysql-client 配置mysql(开启慢查询日志) mysql -uroot -p # 进入mysql # 修改root用户的host, 避免在其他主机上无法登录, 即远程登录 update mysql.user set host = '%' where user = 'root' and host = 'localhost'; flush privileges; # 上一步操作后必须使用该命令进行刷新 # 修改root的密码的几种方式 # 第一种 alter user 'root'@'%' identified by ''; # 第二种, 这种方式需要刷新权限 update user set authentication_string = password('') where user = 'root' and host = '%'; flush privileges; # 第三种 set password for 'root'@'%' = password(''); # 忘记密码, 在配置文件(vi /etc/mysql/my....

June 17, 2019 · 4 min · K8sCat