二进制安装MySQL 5.6
发表于:2026-10-31 作者:千家信息网编辑
千家信息网最后更新 2026年10月31日,二进制安装MySQL 5.6 yum -y install libaio-devel useradd mysql -s /sbin/nologin -M mkdir /data/mysql/{data
千家信息网最后更新 2026年10月31日二进制安装MySQL 5.6
二进制安装MySQL 5.6
yum -y install libaio-devel useradd mysql -s /sbin/nologin -M mkdir /data/mysql/{data,tmp,binlog,log} -pchown -R mysql.mysql /data/mysqltar -xf mysql-5.6.20-linux-glibc2.5-x86_64.tar.gz -C /usr/local/cd /usr/local/mv mysql-5.6.20-linux-glibc2.5-x86_64 mysqlchown -R mysql.mysql /usr/local/mysqlcd /usr/local/mysql/scripts./mysql_install_db --datadir=/data/mysql/data --basedir=/usr/local/mysql --user=mysql --explicit_defaults_for_timestampcp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysqldecho "export PATH=$PATH:/usr/local/mysql/bin" > /etc/profile.d/mysql.shsource /etc/profilechkconfig mysqld on/etc/init.d/mysqld restartps -ef|grep mysql###启动MySQL是报错
Starting MySQL.. ERROR! The server quit without updating PID file (/usr/local/mysql/localhost.pid).
查看mysql的日志
[ERROR] InnoDB: auto-extending data file /data/mysql/data/ibdata1 is of a different size 768 pages (rounded down to MB) than specified in the .cnf file: initial 32000 pages, max 0 (relevant if non-zero) pages![ERROR] InnoDB: Could not open or create the system tablespace. If you tried to add new data files to the system tablespace, and it failed here, you should now edit innodb_data_file_path in my.cnf back to what it was, and remove the new ibdata files InnoDB created in this failed attempt. InnoDB only wrote those files full of zeros, but did not yet use them in any way. But be careful: do not remove old data files which contain your precious data![ERROR] Plugin 'InnoDB' init function returned error.[ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.[ERROR] Unknown/unsupported storage engine: InnoDB[ERROR] Aborting
解决方法:
执行删除命令:rm -rf /data/mysql/data/ib*
删除:ibdata1、ib_logfile0、ib_logfile1文件
重新启动:service mysqld start
#删除测试库
#mysql
mysql> show databases ;mysql> drop database test;
#删除一些没有用的用户
mysql> SELECT DISTINCT CONCAT('User: ''',user,'''@''',host,''';') AS query FROM mysql.user;mysql> drop user 'root'@'::1';mysql> drop user ''@'localhost';mysql> drop user ''@'localhost.localdomain';mysql> drop user 'root'@'localhost.localdomain';#设置数据库登录密码
grant all privileges on *.* to 'root'@'localhost' identified by 'new_pass' with grant option;grant all privileges on *.* to 'root'@'127.0.0.1' identified by 'new_pass' with grant option;flush privileges;
#配置文件
#my.cnf
[mysqld]back_log = 2000basedir = /usr/local/mysqlbinlog-format = MIXEDcharacter_set_server = utf8datadir = /data/mysql/dataevent_scheduler = ONexpire_logs_days = 1innodb_autoinc_lock_mode = 1innodb_buffer_pool_size = 1073741824innodb_data_file_path = ibdata1:500M:autoextendinnodb_data_home_dir = /data/mysql/datainnodb_file_per_table = 1innodb_flush_log_at_trx_commit = 2innodb_flush_method = O_DIRECTinnodb_io_capacity = 2000innodb_log_buffer_size = 8388608innodb_log_files_in_group = 3innodb_log_group_home_dir = /data/mysql/datainnodb_max_dirty_pages_pct = 50innodb_open_files = 1024innodb_read_io_threads = 8innodb_thread_concurrency = 20innodb_write_io_threads = 8innodb_lock_wait_timeout = 10innodb_buffer_pool_load_at_startup = 1innodb_buffer_pool_dump_at_shutdown = 1key_buffer_size = 3221225472innodb_log_file_size = 1Glocal_infile = 1log-bin = /data/mysql/binlog/mysql-bin.loglog_bin_trust_function_creators = 1log_output = FILElong_query_time = 1log-error = /data/mysql/log/error.logmax_allowed_packet = 134217728max_connect_errors = 1000000max_connections = 2000myisam_sort_buffer_size = 33554432myisam_recover = 1join_buffer_size = 8388608tmp_table_size = 33554432net_buffer_length = 8192performance_schema = 1performance_schema_max_table_instances = 200pid-file = /data/mysql/mysqld.pidport = 3306query_cache_size = 0query_cache_type = 0read_buffer_size = 20971520read_rnd_buffer_size = 16Mmax_heap_table_size = 33554432bulk_insert_buffer_size = 134217728#relay-log = /data/mysql/log/mysql-relay.logsecure-file-priv = /data/mysql/tmpserver-id = 1131053306skip-slave-startskip_name_resolveslave-load-tmpdir = /data/mysql/tmpslow-query-log-file = /data/mysql/log/mysql-slow.logslow_query_log = 1socket = /tmp/mysql.socksort_buffer_size = 2097152table_open_cache = 128thread_cache_size = 50tmpdir = /data/mysql/tmpuser = mysqlwait_timeout = 2880000transaction_isolation=read-committedlong_query_time=1sync_binlog=0innodb_flush_log_at_trx_commit=0[mysqld_safe]log-error = /data/mysql/log/error.logpid-file = /data/mysql/mysqld.pid
文件
二进制
命令
密码
数据
数据库
方法
日志
有用
用户
测试
登录
配置
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
南京欣网互联网络科技有限公司
哈尔滨大商圈互联网科技有限公司
互联网科技公司经营范围
云之行互联网科技
新华互联网科技学校
河南真二互联网科技有限公司
互联网为科技
壹账通互联网科技
万达互联网科技
掌上梦互联网科技
云创客互联网科技公司
广州慧亚互联网科技怎么样
华夏互联网科技业
互联网在线教育科技创业
朱啸虎曾投资哪些互联网科技企业
上海创道互联网络科技有限公司
广州梦谷互联网科技有限公司领导
全球科技与互联网公司市值变化
众联互联网络科技
互联网科技快速发展优美句子
互联网科技图片
南京欣网互联网络科技有限公司
广州淘业互联网络科技
河南云网互联网络科技有限公司
互联网科技作文
互联网经济与金融科技
湖北码尼互联网科技有限公司电话
黑云互联网科技有限公司
盐城市攀科互联网科技有限公司
科技发展第三阶段互联网时代