GreatSQL社区

搜索

[已解决] mysql 客户端启动报错

2116 5 2024-2-25 14:38
参考 https://greatsql.cn/docs/8032-25 ... centos-install.html 安装完成,确认server 进程已经启动,随后,尝试进入客户端;

mysql 版本信息:mysql  Ver 8.0.25 for Linux on x86_64 (Source distribution)


报错:ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

/tmp 目录下只有 mysqlx.sock;

尝试:建立软连接ln -s mysqlx.sock mysql.sock

报错:ERROR 2007 (HY000): Protocol mismatch; server version = 11, client version = 10


其他信息:
datadir目录下存在mysql.sock mysql.sock.lock文件,不知有什么用

错误日志:


2024-02-25T13:51:45.183465+08:00 0 [Warning] [MY-010068] [Server] CA certificate ca.pem is self signed.
2024-02-25T13:51:45.183507+08:00 0 [System] [MY-013602] [Server] Channel mysql_main configured to support TLS. Encrypted connections are now supported for this channel.
2024-02-25T13:51:45.183549+08:00 0 [Note] [MY-010308] [Server] Skipping generation of RSA key pair through --sha256_password_auto_generate_rsa_keys as key files are present in data directory.
2024-02-25T13:51:45.183561+08:00 0 [Note] [MY-010308] [Server] Skipping generation of RSA key pair through --caching_sha2_password_auto_generate_rsa_keys as key files are present in data directory.
2024-02-25T13:51:45.183710+08:00 0 [Note] [MY-010252] [Server] Server hostname (bind-address): '*'; port: 3306
2024-02-25T13:51:45.183891+08:00 0 [Note] [MY-010253] [Server] IPv6 is available.
2024-02-25T13:51:45.183902+08:00 0 [Note] [MY-010264] [Server]   - '::' resolves to '::';
2024-02-25T13:51:45.183917+08:00 0 [Note] [MY-010251] [Server] Server socket created on IP: '::'.
2024-02-25T13:51:45.204209+08:00 0 [Note] [MY-011025] [Repl] Failed to start slave threads for channel ''.
2024-02-25T13:51:45.205812+08:00 5 [Note] [MY-010051] [Server] Event Scheduler: scheduler thread started with id 5
2024-02-25T13:51:45.205844+08:00 0 [System] [MY-010931] [Server] /usr/local/GreatSQL-8.0.32-25-Linux-glibc2.17-x86_64/bin/mysqld: ready for connections. Version: '8.0.32-25'  socket: '/home/data_redo/yxz/data/GreatSQL/mysql.sock'  port: 3306  GreatSQL, Release 25, Revision 79f57097e3f.
2024-02-25T13:51:45.205956+08:00 0 [Note] [MY-011240] [Server] Plugin mysqlx reported: 'Using SSL configuration from MySQL Server'
2024-02-25T13:51:45.206377+08:00 0 [Note] [MY-011243] [Server] Plugin mysqlx reported: 'Using OpenSSL for TLS connections'
2024-02-25T13:51:45.206483+08:00 0 [System] [MY-011323] [Server] X Plugin ready for connections. Bind-address: '::' port: 33060, socket: /tmp/mysqlx.sock
2024-02-25T13:55:37.259684+08:00 8 [Note] [MY-010914] [Server] Got an error reading communication packets



全部回复(5)
KAiTO 2024-2-26 09:24:51
麻烦提供下配置的my.cnf文件
看你输出的版本号是mysql  Ver 8.0.25 你装的是GreatSQL 8.0.32-25
是否存在两个数据库?如果是的话你的数据目录、my.cnf文件、端口号等要隔离开,否则会出现共用同一个。
如果只要测试体验GreatSQL 可以用Docker 直接拉取即可

cse_engineer 2024-2-26 09:28:03
KAiTO 发表于 2024-2-26 09:24
麻烦提供下配置的my.cnf文件

[client]

user = root
socket        = /home/data_redo/yxz/data/GreatSQL/mysql.sock

[mysqld]
user        = greatsqlyxz
port        = 3306
#主从复制或MGR集群中,server_id记得要不同
#另外,实例启动时会生成 auto.cnf,里面的 server_uuid 值也要不同
#server_uuid的值还可以自己手动指定,只要符合uuid的格式标准就可以
server_id = 3306

basedir = /usr/local/GreatSQL-8.0.32-25-Linux-glibc2.17-x86_64
datadir        = /home/data_redo/yxz/data/GreatSQL
socket= /home/data_redo/yxz/data/GreatSQL/mysql.sock
pid-file = mysql.pid
character-set-server = UTF8MB4
skip_name_resolve = 1
#若你的MySQL数据库主要运行在境外,请务必根据实际情况调整本参数
default_time_zone = "+8:00"

default_authentication_plugin=mysql_native_password

#performance setttings
lock_wait_timeout = 3600
open_files_limit    = 65535
back_log = 1024
max_connections = 512
max_connect_errors = 1000000
table_open_cache = 1024
table_definition_cache = 1024
thread_stack = 512K
sort_buffer_size = 4M
join_buffer_size = 4M
read_buffer_size = 8M
read_rnd_buffer_size = 4M
bulk_insert_buffer_size = 64M
thread_cache_size = 768
interactive_timeout = 600
wait_timeout = 600
tmp_table_size = 32M
max_heap_table_size = 32M
max_allowed_packet = 64M
net_buffer_shrink_interval = 180
#GIPK
loose-sql_generate_invisible_primary_key = ON

#log settings
log_timestamps = SYSTEM
log_error = /home/data_redo/yxz/data/GreatSQL/error.log
log_error_verbosity = 3
slow_query_log = 1
log_slow_extra = 1
slow_query_log_file = slow.log
#设置slow log文件大小1G及总文件数10
max_slowlog_size = 1073741824
max_slowlog_files = 10
long_query_time = 0.1
log_queries_not_using_indexes = 1
log_throttle_queries_not_using_indexes = 60
min_examined_row_limit = 100
log_slow_admin_statements = 1
log_slow_slave_statements = 1
log_bin = binlog
binlog_format = ROW
sync_binlog = 1
binlog_cache_size = 4M
max_binlog_cache_size = 2G
max_binlog_size = 1G
#控制binlog总大小,避免磁盘空间被撑爆
binlog_space_limit = 500G
binlog_rows_query_log_events = 1
binlog_expire_logs_seconds = 604800
#MySQL 8.0.22前,想启用MGR的话,需要设置binlog_checksum=NONE才行
binlog_checksum = CRC32
gtid_mode = ON
enforce_gtid_consistency = TRUE

#myisam settings
key_buffer_size = 32M
myisam_sort_buffer_size = 128M

#replication settings
relay_log_recovery = 1
slave_parallel_type = LOGICAL_CLOCK
#可以设置为逻辑CPU数量的2倍
slave_parallel_workers = 64
binlog_transaction_dependency_tracking = WRITESET
slave_preserve_commit_order = 1
slave_checkpoint_period = 2

#mgr settings
#loose-plugin_load_add = 'mysql_clone.so'
#loose-plugin_load_add = 'group_replication.so'
#loose-group_replication_group_name = "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaa1"

#MGR本地节点IPORT,请自行替换
#loose-group_replication_local_address = "172.16.16.10:33061"

#MGR集群所有节点IPORT,请自行替换
#loose-group_replication_group_seeds = "172.16.16.10:33061,172.16.16.11:33061,172.16.16.12:33061"
#loose-group_replication_start_on_boot = OFF
#loose-group_replication_bootstrap_group = OFF
#loose-group_replication_exit_state_action = READ_ONLY
#loose-group_replication_flow_control_mode = "DISABLED"
#loose-group_replication_single_primary_mode = ON
#loose-group_replication_majority_after_mode = ON
#loose-group_replication_communication_max_message_size = 10M
#loose-group_replication_arbitrator = 0
#loose-group_replication_single_primary_fast_mode = 1
#loose-group_replication_request_time_threshold = 100
#loose-group_replication_primary_election_mode = GTID_FIRST
#loose-group_replication_unreachable_majority_timeout = 0
#loose-group_replication_member_expel_timeout = 5
#loose-group_replication_autorejoin_tries = 288
#report_host = "172.16.16.10"

#innodb settings
innodb_buffer_pool_size = 2G
innodb_buffer_pool_instances = 8
innodb_data_file_path = ibdata1:12M:autoextend
innodb_flush_log_at_trx_commit = 1
innodb_log_buffer_size = 32M
innodb_log_file_size = 2G
innodb_log_files_in_group = 3
innodb_redo_log_capacity = 6G
innodb_max_undo_log_size = 4G
# 根据您的服务器IOPS能力适当调整
# 一般配普通SSD盘的话,可以调整到 10000 - 20000
# 配置高端PCIe SSD卡的话,则可以调整的更高,比如 50000 - 80000
innodb_io_capacity = 4000
innodb_io_capacity_max = 8000
innodb_open_files = 65535
innodb_flush_method = O_DIRECT
innodb_lru_scan_depth = 4000
innodb_lock_wait_timeout = 10
innodb_rollback_on_timeout = 1
innodb_print_all_deadlocks = 1
innodb_online_alter_log_max_size = 4G
innodb_print_ddl_logs = 0
innodb_status_file = 1
#注意: 开启 innodb_status_output & innodb_status_output_locks 后, 可能会导致log_error文件增长较快
innodb_status_output = 0
innodb_status_output_locks = 1
innodb_sort_buffer_size = 67108864
innodb_adaptive_hash_index = 0
#开启NUMA支持
innodb_numa_interleave = ON
innodb_print_lock_wait_timeout_info = 1
#自动杀掉超过5分钟不活跃事务,避免行锁被长时间持有
kill_idle_transaction = 300

#innodb monitor settings
#innodb_monitor_enable = "module_innodb,module_server,module_dml,module_ddl,module_trx,module_os,module_purge,module_log,module_lock,module_buffer,module_index,module_ibuf_system,module_buffer_page,module_adaptive_hash"

#innodb parallel query
loose-force_parallel_execute = OFF
loose-parallel_default_dop = 8
loose-parallel_max_threads = 96
temptable_max_ram = 8G

#pfs settings
performance_schema = 1
#performance_schema_instrument = '%memory%=on'
performance_schema_instrument = '%lock%=on'
KAiTO 2024-2-26 09:29:35

你把socket= /home/data_redo/yxz/data/GreatSQL/mysql.sock 放在这里了
你自己指定下 -S 使用socket 链接
王权富贵 2024-2-26 10:18:23
发一下 你的登录命令
reddey 2024-5-14 08:48:46
直接用SOCKET登录看一下
一个学艺不精的国产数据库爱好者
cse_engineer

10

主题

0

博客

32

贡献

注册会员

Rank: 2

积分
53

助人为乐(铜)勤学好问(铜)

合作电话:010-64087828

社区邮箱:greatsql@greatdb.com

社区公众号
社区小助手
QQ群
GMT+8, 2024-12-4 01:20 , Processed in 0.021546 second(s), 17 queries , Redis On.
快速回复 返回顶部 返回列表