yum安装mysql8.0服务起不来,yum安装mysql8.0时候,初始化报错

报错日志如下:

2019-08-16T06:10:30.156632Z 0 [ERROR] [MY-010338] [Server] Can't find error-message file '/soft/src/mysql/mysql8/share/mysql-8.0/errmsg.sys'. Check error-message file location and 'lc-messages-dir' configuration directive.

配置文件my.cnf如下:

[client]

port = 3303

socket = /soft/src/mysql/mysql8/sock/mysqlx.sock

max_allowed_packet = 48M

[mysql]

no-auto-rehash

socket = /soft/src/mysql/mysql8/sock/mysqlx.sock

[mysqldump]

quick

max_allowed_packet = 64M

[isamchk]

key_buffer = 128M

sort_buffer_size = 128M

read_buffer = 2M

write_buffer = 2M

[myisamchk]

key_buffer = 128M

sort_buffer_size = 128M

read_buffer = 2M

write_buffer = 2M

[mysqlhotcopy]

interactive-timeout=1800

[mysqld_safe]

open-files-limit = 8192

[mysqld]

server-id = 50

port = 3303

basedir = /soft/src/mysql/mysql8

datadir = /soft/src/mysql/mysql8/data

datadir = /soft/src/mysql/mysql8/data

socket = /soft/src/mysql/mysql8/sock/mysqlx.sock

pid-file = /soft/src/mysql/mysql8/mysql.pid

log-error = /soft/src/mysql/mysql8/logs/mysql.err

#default-character-set=utf8

character-set-server = utf8

back_log = 512

wait_timeout=1800

lock_wait_timeout=1800

interactive_timeout=1800

max_connections = 2048

connect_timeout = 20

max_connect_errors = 128

open_files_limit = 8192

table_open_cache = 2048

max_allowed_packet = 16M

read_buffer_size = 32M

sort_buffer_size = 32M

read_rnd_buffer_size = 16M

join_buffer_size = 32M

key_buffer_size = 1024M

bulk_insert_buffer_size = 64M

thread_cache_size = 8

thread_stack = 240K

ft_min_word_len = 4

default-storage-engine = INNODB

transaction_isolation = REPEATABLE-READ

tmp_table_size = 256M

max_heap_table_size = 64M

log-bin=/soft/src/mysql/mysql8/logs/mysql-bin

binlog_format=mixed

binlog_cache_size = 1M

expire_logs_days = 15

slow_query_log = ON

slow_launch_time = 2

slow_query_log_file = /soft/src/mysql/mysql8/logs/slow.log

long_query_time = 1

myisam_sort_buffer_size = 64M

myisam_max_sort_file_size = 2G

myisam_repair_threads = 1

myisam-recover-options = BACKUP,FORCE

innodb_data_file_path = ibdata1:10M:autoextend

innodb_write_io_threads = 8

innodb_read_io_threads = 8

innodb_thread_concurrency = 16

innodb_flush_log_at_trx_commit = 1

#memlock

innodb_buffer_pool_instances=4

innodb_buffer_pool_size = 1G

innodb_log_file_size = 512M

innodb_lock_wait_timeout = 60

innodb_flush_log_at_trx_commit = 0

### small swap / IO

innodb_flush_method = O_DIRECT

innodb_log_buffer_size = 8M

innodb_log_files_in_group = 3

innodb_max_dirty_pages_pct = 90

innodb_file_per_table = 1

innodb_open_files = 2048

skip-external-locking

secure-file-priv=/soft/src/mysql/mysql8/tmp

log_queries_not_using_indexes = 0

解决:

[root@localhost share]# pwd

/usr/share

[root@localhost share]# cp -r mysql-8.0/ /soft/src/mysql/mysql8/share/

[root@localhost share]# systemctl restart mysqld

另一种方法:

直接修改配置文件my.cnf,在mysqld下面加入一条

lc-messages-dir = /usr/share/mysql-8.0/

然后报错就没了~不知道对不对坐等大神坐等~~等~

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
以下是在Red Hat Enterprise Linux Server release 7.6上源码编译安装MySQL 8.0.X的步骤: 1. 下载MySQL源码包并解压缩: ```shell wget https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.18.tar.gz tar -zxvf mysql-8.0.18.tar.gz ``` 2. 安装编译MySQL所需的依赖包: ```shell yum install -y cmake gcc gcc-c++ ncurses-devel openssl-devel bison ``` 3. 进入MySQL源码目录,创建一个用于编译的目录: ```shell cd mysql-8.0.18 mkdir build cd build ``` 4. 运行cmake命令生成Makefile文件: ```shell cmake .. -DCMAKE_INSTALL_PREFIX=/usr/local/mysql \ -DMYSQL_DATADIR=/usr/local/mysql/data \ -DSYSCONFDIR=/etc \ -DWITH_MYISAM_STORAGE_ENGINE=1 \ -DWITH_INNOBASE_STORAGE_ENGINE=1 \ -DWITH_MEMORY_STORAGE_ENGINE=1 \ -DWITH_READLINE=1 \ -DENABLED_LOCAL_INFILE=1 \ -DMYSQL_TCP_PORT=3306 \ -DWITH_SSL=system \ -DWITH_ZLIB=system \ -DWITH_LIBEDIT=1 \ -DDEFAULT_CHARSET=utf8mb4 \ -DDEFAULT_COLLATION=utf8mb4_general_ci ``` 5. 运行make命令进行编译: ```shell make ``` 6. 运行make install命令进行安装: ```shell make install ``` 7. 配置MySQL环境变量: ```shell echo 'export PATH=$PATH:/usr/local/mysql/bin' >> /etc/profile source /etc/profile ``` 8. 初始化MySQL: ```shell cd /usr/local/mysql bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data ``` 9. 启动MySQL服务: ```shell bin/mysqld_safe --user=mysql & ``` 10. 修改MySQL的root用户密码: ```shell bin/mysqladmin -u root password 'new-password' ``` 以上是在Red Hat Enterprise Linux Server release 7.6上源码编译安装MySQL 8.0.X的步骤。如果您遇到了问题,可以参考MySQL官方文档或者在MySQL社区寻求帮助。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值