当前位置:网站首页>centos7 mysql 记录
centos7 mysql 记录
2022-06-23 05:38:00 【小代码2016】
安装
# 添加社区资源的rpm包
rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm
# 安装
yum -y install mysql-community-server
配置文件
位置:/etc/my.cnf
[client]
port=3306
password=root
default-character-set=utf8
[mysqld]
port=3306
character-set-server=utf8
character-set-client=utf8
init_connect='SET NAMES utf8'
# 不区分大小写
lower_case_table_names=1
# 最大链接数
max_connection=1000
# 慢查询日志
#slow_query_log=1
#slow_query_log_file=/var/lib/mysql/km-base-slow.log
#long_query_time=2
#log_queries_not_using_indexes=0
# 开启慢查询后,不添加如下配置,创建函数会出错
#log_bin_trust_function_creators=1
#
# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M
#
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
#
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
# Recommended in standard MySQL setup
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
[mysql]
# 自动提示,默认是没有开启的
no-auto-rehash
#auto-rehash
default-character-set=utf8
重置密码
use mysql;
UPDATE user SET password=PASSWORD("root") WHERE user='root';
FLUSH PRIVILEGES;
quit;
远程访问
use mysql;
grant all privileges on *.* to 'root'@'%' identified by 'root';
flush privileges;
开机启动
# 启动
systemctl start mysql
# 开机启动
systemctl enable mysql
边栏推荐
- 解析创客教育中的个性化学习进度
- redux Actions may not have an undefined “type“ property. Have you misspelled a constant?
- 把CSMA/CD、Token Bus、Token Ring说清楚
- 【shell】Tree命令
- Leetcode notes: Weekly contest 298
- 光谱共焦的测量原理及厚度测量模式
- [resolved] "the unity environment took too long to respond. make sure that: \n“
- Xray linkage crawlergo automatic scanning pit climbing record
- 常见设置模式(抽象工厂&责任链模式&观察者模式)
- Summary of qvariant use in QT
猜你喜欢

MySQL ON DUPLICATE KEY 和 PgSQL ON CONFLICT(主键) 处理主键冲突

解读创客教育中的团结协作精神

如何迁移virtualbox 的虚拟机到hype-v

How to maintain secure encryption of email communication with FDA?

redux Actions may not have an undefined “type“ property. Have you misspelled a constant?

Synchronous switching power supply reduces EMI layout dv/dt di/dt

Easy EDA #学习笔记09# | ESP32-WROOM-32E模组ESP32-DevKitC-V4开发板 一键下载电路

C # database reports errors. Let's have a look

Laravel log channel grouping configuration

使用ts-node直接运行TypeScript代码
随机推荐
Add IPAD control function into shairplay
C Advanced Learning -- Reflection
下载oss文件并修改文件名
Open source to the world (Part 2): the power of open source from the evolution of database technology BDTC 2021
Linked Storage
LeetCode笔记:Weekly Contest 298
Usage Summary of item views and item widgets controls in QT
Network architecture from Wan to sd-wan edge devices
2.17 haas506 2.0开发教程-system(仅支持2.2以上版本)
redux Actions may not have an undefined “type“ property. Have you misspelled a constant?
leetcode - 572. A subtree of another tree
开源OAuth2框架 实现SSO单点登录
Easy EDA learning notes 09 esp32-wroom-32e module esp32-devkitc-v4 development board one click download circuit
haas506 2.0开发教程-sntp(仅支持2.2以上版本)
xml dtd 记录
How to view native IP
【踩坑记录】数据库连接未关闭连接,释放资源的坑
Set tensorflow1 X to pytorch
Haas 506 2.0 Tutoriel de développement - bibliothèque de composants avancés - modem. SMS (ne prend en charge que les versions supérieures à 2,2)
json转化为proto