mysql - centos7上配置MySQL8.0
问题描述
首先,在执行订单时
mysql -u root -p
Enter password:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
,它会出错。
二、执行订单时
systemctl status mysqld
● mysqld.service - MySQL Server
Loaded: loaded (/etc/systemd/system/mysqld.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since 三 2019-10-30 01:29:29 CST; 20min ago
Process: 30824 ExecStart=/usr/bin/mysqld --defaults-file=/etc/mysql/my.cnf --datadir=/var/lib/mysql/data --socket=/var/run/mysqld/mysqld.sock User=mysql (code=exited, status=203/EXEC)
Main PID: 30824 (code=exited, status=203/EXEC)
10月 30 01:29:29 VM_0_6_centos systemd[1]: Started MySQL Server.
10月 30 01:29:29 VM_0_6_centos systemd[1]: Starting MySQL Server...
10月 30 01:29:29 VM_0_6_centos systemd[1]: mysqld.service: main process exited, code=exited, status=203/EXEC
10月 30 01:29:29 VM_0_6_centos systemd[1]: Unit mysqld.service entered failed state.
10月 30 01:29:29 VM_0_6_centos systemd[1]: mysqld.service failed.
三、mysql的default_file是my.cnf:
1 # For advice on how to change settings please see
2 # http://dev.mysql.com/doc/refman/8.0/en/server-configuration-defaults.html
3
4 [mysqld]
5 #
6 # Remove leading # and set to the amount of RAM for the most important data
7 # cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
8 # innodb_buffer_pool_size = 128M
9 #
10 # Remove the leading "# " to disable binary logging
11 # Binary logging captures changes between backups and is enabled by
12 # default. It's default setting is log_bin=binlog
13 # disable_log_bin
14 #
15 # Remove leading # to set options mainly useful for reporting servers.
16 # The server defaults are faster for transactions and fast SELECTs.
17 # Adjust sizes as needed, experiment to find the optimal values.
18 # join_buffer_size = 128M
19 # sort_buffer_size = 2M
20 # read_rnd_buffer_size = 2M
21 #
22 # Remove leading # to revert to previous value for default_authentication_plugin,
23 # this will increase compatibility with older clients. For background, see:
24 # https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_default_authentic ation_plugin
25 # default-authentication-plugin=mysql_native_password
26
27 datadir=/var/lib/mysql
28 socket=/var/lib/mysql/mysql.sock
29
30 log-error=/var/log/mysqld.log
31 pid-file=/var/run/mysqld/mysqld.pid
32
33 [mysql]
34
35 socket=/var/lib/mysql/mysql.sock
36 [client]
37 socket=/tmp/mysql.sock
四、我的机器里找不到mysql.sock、mysql.server和mysql_safe。安装mysql-server后还是出错。
yum install mysql-server
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Package mysql-community-server-8.0.18-1.el7.x86_64 already installed and latest version
Nothing to do
[root@VM_0_6_centos /root]# find ./* -name mysql.server
我能做些什么?
解决方案
推荐阅读
- android - 使用导航组件和菜单项如何让向上按钮返回上一个片段而不是“主”片段
- java - 使用java spark将数据集保存到cassandra
- mysql - 为什么我会从此存储过程中收到 Null?
- php - PHP 警告:非法字符串偏移,错误
- sql - 需要帮助消除 Null 数据并检索上个月的记录
- mysql - 需要查询修复和优化帮助(找到每周股票数据的最高价、最低价和最后已知的收盘价)
- qt - 用于文本编辑的 QtQuick.Controls 2.x 上下文菜单
- html - 将 Excel 超链接到网页上的 html 特定信息(链接)不起作用
- import - Odoo 13 进口产品的变体
- spring - 关于 3 种情况下生成的 Hibernate Queries 的问题