当前位置:网站首页>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
边栏推荐
猜你喜欢

How to maintain secure encryption of email communication with FDA?

20220621 Three Conjugates of Dual Quaternions

如何查看本机IP

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

c#数据库报错问题大家帮我看看吧

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

idea的去除转义的复制粘贴

20220621 Dual Quaternion

mingw-w64、msys和ffmpeg的配置与编译

Laravel log channel 分组配置
随机推荐
C # database reports errors. Let's have a look
Explain csma/cd, token bus and token ring clearly
Summary of business logic security ideas
Test of ers function under the supplier consignment purchase mode of SAP mm
光谱共焦的测量原理及厚度测量模式
疫情下的传媒产业,小程序生态驱动数字化转型探索
Verilog语法讲解
haas506 2.0開發教程-高級組件庫-modem.sms(僅支持2.2以上版本)
MySQL5.6 (5.7-8) 基于shardingsphere5.1.1 Sharding-Proxy模式读写分离
Index - MySQL
Vs+qt project transferred to QT Creator
Open source to the world (Part 2): the power of open source from the evolution of database technology BDTC 2021
2.17 haas506 2.0开发教程-system(仅支持2.2以上版本)
bootstrap如何清除浮动的样式
Programmers' real ideas | daily anecdotes
Miscellaneous things
Haas506 2.0 development tutorial - Advanced Component Library -modem Sim (only supports versions above 2.2)
数值计算方法 Chapter7. 计算矩阵的特征值和特征向量
js中if逻辑过多,常见优化
把CSMA/CD、Token Bus、Token Ring说清楚