您现在的位置是:主页 > news > 郑州网站建设案例/公司品牌宣传方案
郑州网站建设案例/公司品牌宣传方案
admin2025/5/5 23:24:37【news】
简介郑州网站建设案例,公司品牌宣传方案,烟台网络公司员工人数,做动态网站需要学什么使用rpm卸载、安装MYSQL8.0及使用source命令导入大SQL文件很慢的问题! 安装参考 MYSQL8.0 安装 上传MYSQL8.0.23安装包到 /usr/local/mysql下,该目录不存在,创建。 解压MYSQL8.0.23 tar -xvf mysql-8.0.23-1.el7.x86_64.rpm-bundle.tar 解…
使用rpm卸载、安装MYSQL8.0及使用source命令导入大SQL文件很慢的问题!
安装参考
MYSQL8.0 安装
-
上传MYSQL8.0.23安装包到 /usr/local/mysql下,该目录不存在,创建。
-
解压MYSQL8.0.23
tar -xvf mysql-8.0.23-1.el7.x86_64.rpm-bundle.tar
解压结果如下:
-
执行rpm安装
rpm包有依赖关系,需要顺序安装!
rpm -ivh mysql-community-common-8.0.23-1.el7.x86_64.rpm --nodeps --forcerpm -ivh mysql-community-libs-8.0.23-1.el7.x86_64.rpm --nodeps --forcerpm -ivh mysql-community-client-8.0.23-1.el7.x86_64.rpm --nodeps --forcerpm -ivh mysql-community-server-8.0.23-1.el7.x86_64.rpm --nodeps --force
-
检查是否安装成功
rpm -qa | grep mysql
-
初始化
mysqld --initialize
-
文件目录授权
cd /var/lib/mysql chmod 777 ibdata1
chown mysql:mysql /var/lib/mysql/*
-
启动并登录
启动:service mysqld start
查看状态:service mysqld status
停止:service mysqld stop
查看初始化密码:cat /var/log/mysqld.log | grep passwordmysql -u root -p初始化密码
修改初始化密码
alter user "root"@"localhost" identified by "密码";
创建新用户并授权远程访问
create user 'account'@'%' identified with mysql_native_password by '密码'; grant all privileges on *.* to 'account'@'%' with grant option;flush privileges;
MYSQL8.0.23 卸载
-
查看是否安装
rpm -qa| grep mysql
-
停止服务
service mysqld stop
-
删除
rpm -e --nodeps mysql-community-client-8.0.23-1.el7.x86_64 ....
-
查看MYSQL目录
fina / -name mysql
查询除目录文件。删除!
删除 /etc/my.cnf 文件
MYSQL8.0.23 my.cnf 配置 source 慢问题,作此记录
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/8.0/en/server-configuration-defaults.html[mysqld]
#
# 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 the leading "# " to disable binary logging
# Binary logging captures changes between backups and is enabled by
# default. It's default setting is log_bin=binlog
# disable_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
#
# Remove leading # to revert to previous value for default_authentication_plugin,
# this will increase compatibility with older clients. For background, see:
# https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_default_authentication_plugin
# default-authentication-plugin=mysql_native_passworddatadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.socklower_case_table_names=2
sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION'log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
performance_schema_max_table_instances = 400
table_definition_cache = 400
skip-external-locking
key_buffer_size = 1024M
max_allowed_packet = 100G
table_open_cache = 4096
sort_buffer_size = 16M
net_buffer_length = 4K
read_buffer_size = 16M
read_rnd_buffer_size = 256K
myisam_sort_buffer_size = 256M
thread_cache_size = 512
tmp_table_size = 512M
default_authentication_plugin = mysql_native_password
wait_timeout=315360000
interactive_timeout=315360000explicit_defaults_for_timestamp = true
#skip-name-resolve
max_connections = 500
max_connect_errors = 100
open_files_limit = 65535innodb_buffer_pool_size = 4096M
innodb_log_file_size = 2048M
innodb_log_buffer_size = 512M
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 50
innodb_max_dirty_pages_pct = 90
innodb_read_io_threads = 24
innodb_write_io_threads = 24
secure_file_priv=''[mysqldump]
quick
max_allowed_packet = 500M[mysql]
no-auto-rehash[myisamchk]
key_buffer_size = 1024M
sort_buffer_size = 16M
read_buffer = 2M
write_buffer = 2M
[mysqlhotcopy]
interactive-timeout