MySql 未运行;Ubuntu 16.04

MySql 未运行;Ubuntu 16.04

下列错误。

systemctl status mysql.service● mysql.service - MySQL Community Server  

   Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: en  
   Active: activating (start-post) (Result: exit-code) since Tue 2016-07-05 23:1  
  Process: 26691 ExecStart=/usr/sbin/mysqld (code=exited, status=1/FAILURE)  
  Process: 26687 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exi  
 Main PID: 26691 (code=exited, status=1/FAILURE);         : 26692 (mysql-systemd  
   CGroup: /system.slice/mysql.service  
           └─control  
             ├─26692 /bin/bash /usr/share/mysql/mysql-systemd-start post  
             └─26735 sleep 1  

Jul 05 23:19:16 g4080 systemd[1]: Starting MySQL Community Server...  
Jul 05 23:19:16 g4080 mysqld[26691]: mysqld: [ERROR] Found option without preced  
Jul 05 23:19:16 g4080 systemd[1]: mysql.service: Main process exited, code=exite  
lines 1-14/14 (END)

我的配置文件如所问,请建议应该配置什么,我是 mySql 安装的新手

GNU nano 2.5.3 文件:/etc/mysql/my.cnf

至以下之一:

# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html

#
# * IMPORTANT: Additional settings that can override those from this file!
#   The files must end with '.cnf', otherwise they'll be ignored.
#

!includedir /etc/mysql/conf.d/
includedir /etc/mysql/mysql.conf.d/default_storage_engine = innodb

innodb_file_per_table = 1

innodb_file_format = Barracuda

答案1

(截断的)行“找到没有前缀的选项”最初读的是这样的

Found option without preceding group in config file: /etc/mysql/my.cnf at line: 123

my.cnf如果是这种情况,则文件中可能存在未分配给组的选项。该my.cnf文件分为几个组,一个组包含 MySQL 服务器的选项,一个组包含(命令行)客户端的选项,一个组包含 的选项,等等mysqldump。如果某个选项不属于任何此类组,MySQL 就不知道将其应用于什么。

如果你的配置中没有“未归因”选项,但 MySQL 仍然抱怨,你可能需要看看文件的编码

相关内容