初始化MYSQL数据库遇到一些问题

初始化MYSQL数据库的时候提示缺少perl和data::dumper

这个时候需要安装两个包,

yum install perl

yum install autoconf

初始化MYSQL数据库的时候提示innodb数据库文件大小错误

2018-08-28 18:01:51 26794 [ERROR] InnoDB: auto-extending data file ./ibdata1 is of a different size 768 pages (rounded down to MB) than specified in the .cnf file: initial 131072 pages, max 0 (relevant if non-zero) pages!
2018-08-28 18:01:51 26794 [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!
2018-08-28 18:01:51 26794 [ERROR] Plugin ‘InnoDB‘ init function returned error.
2018-08-28 18:01:51 26794 [ERROR] Plugin ‘InnoDB‘ registration as a STORAGE ENGINE failed.
2018-08-28 18:01:51 26794 [ERROR] Unknown/unsupported storage engine: InnoDB
2018-08-28 18:01:51 26794 [ERROR] Aborting

这是因为系统中有其他my.cnf文件。只要初始化的时候指定初始化文件my.cnf,就可以了。

 /opt/mysql/scripts/mysql_install_db --datadir=/data/mysqldata/3306/data --basedir=/opt/mysql --defaults-file=‘/data/mysqldata/3306/my.cnf‘
Installing MySQL system tables...2018-08-28 18:04:30 0 [Note] /opt/mysql/bin/mysqld (mysqld 5.6.31-log) starting as process 26865 ...

OK

Filling help tables...2018-08-28 18:05:03 0 [Note] /opt/mysql/bin/mysqld (mysqld 5.6.31-log) starting as process 26889 ...
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

  /opt/mysql/bin/mysqladmin -u root password ‘new-password‘
  /opt/mysql/bin/mysqladmin -u root -h mysql01 password ‘new-password‘

Alternatively you can run:

  /opt/mysql/bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:

  cd . ; /opt/mysql/bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl

  cd mysql-test ; perl mysql-test-run.pl

Please report any problems at http://bugs.mysql.com/

The latest information about MySQL is available on the web at

  http://www.mysql.com

Support MySQL by buying support/licenses at http://shop.mysql.com

WARNING: Found existing config file /opt/mysql/my.cnf on the system.
Because this file might be in use, it was not replaced,
but was used in bootstrap (unless you used --defaults-file)
and when you later start the server.
The new default config file was created as /opt/mysql/my-new.cnf,
please compare it with your file and take the changes you need.

WARNING: Default config file /etc/my.cnf exists on the system
This file will be read by default by the MySQL server
If you do not want to use this, either remove it, or use the
--defaults-file argument to mysqld_safe when starting the server

原文地址:http://blog.51cto.com/accole/2165609

时间: 2024-12-10 13:26:34

初始化MYSQL数据库遇到一些问题的相关文章

EF初始化mysql数据库codefirst

EF使用Code First修改生成数据库表名的方法 1. 重写OnModelCreating,去掉表名复数 System.Data.Entity.ModelConfiguration.Conventions; public class MovieDBContext : DbContext     {         public DbSet<Movie> Movies { get; set; }         protected override void OnModelCreating(

初始化mysql数据库

无论你是编译安装,二进制安装,还是yum,rpm,装完mysql都是要初始化才能用. 下面来介绍下初始化安装mysql,安装前要准备好my.cnf文件噢~!怎么配置my.cnf,可以看我另一篇文章. 不过要注意的是,发行版和版本号的不同,有些参数会不同或不可用,会导致初始化失败,这时需要去初始化的数据目录查看mysql.err,看看那个参数有问题,然后屏蔽了,重新再初始化一次. -前置步骤,已做就可以不用理会 mkdir -p /data/mysql/data groupadd mysql us

应用EF初始化Mysql数据库不能使用中文的处理方法

问题描述: 在应用ASP.NET EF Core时,采用了第三方的工具.在初始化Mysql数据时,中文不被支持,报错,改为英文就可以. 问题分析: 查看生产的数据库表,发现字符集是latin1,该字符集不支持中文,在里面直接修改内容为中文一样会报错. 解决方法: 修改My.ini(修改前需要先关闭mysql服务) [mysql]default-character-set = utf8mb4 [mysqld]character-set-server = utf8mb4 修改后不要直接保存,直接保存

初始化mysql数据库——Activiti BPM

1 package com.initialize; 2 3 import org.activiti.engine.ProcessEngine; 4 import org.activiti.engine.ProcessEngineConfiguration; 5 import org.junit.Test; 6 7 public class TestActiviti { 8 /** 使用代码创建工作流所需的25张表 **/ 9 @Test 10 public void test() { 11 Pr

初始化mysql数据库 /usr/bin/mysql_install_db执行时报错

错误描述: FATAL ERROR: please install the following Perl modules before executing /usr/bin/mysql_install_db:Data::Dumper 解决办法: 安装autoconf库 yum -y install autoconf 再次运行 /usr/bin/mysql_install_db,错误解决. 原文地址:https://www.cnblogs.com/syq816/p/8582628.html

CentOS6.4下Mysql数据库的安装与配置

转自:http://www.cnblogs.com/xiaoluo501395377/archive/2013/04/07/3003278.html 如果要在Linux上做j2ee开发,首先得搭建好j2ee的开发环境,包括了jdk.tomcat.eclipse的安装(这个在之前的一篇随笔中已经有详细讲解了Linux学习之CentOS(七)--CentOS下j2ee环境搭建),如果要开发web项目,我们当然可以安装一个myeclipse到Linux系统上去,这个安装方法和安装eclipse完全相同

Linux学习之CentOS(十三)--CentOS6.4下Mysql数据库的安装与配置

原文:http://www.cnblogs.com/xiaoluo501395377/archive/2013/04/07/3003278.html 如果要在Linux上做j2ee开发,首先得搭建好j2ee的开发环境,包括了jdk.tomcat.eclipse的安装(这个在之前的一篇随笔中已经有详细讲解了Linux学习之CentOS(七)--CentOS下j2ee环境搭建),如果要开发web项目,我们当然可以安装一个myeclipse到Linux系统上去,这个安装方法和安装eclipse完全相同

Linux CentOS6.4下Mysql数据库的安装与配置

一.mysql简介 说到数据库,我们大多想到的是关系型数据库,比如mysql.oracle.sqlserver等等,这些数据库软件在windows上安装都非常的方便,在Linux上如果要安装数据库,咱不得不首先推荐的是mysql数据库了,而且Mysql数据库的第一个版本就是发行在Linux系统上的. MySQL是一个关系型数据库管理系统,由瑞典MySQL AB公司开发,目前属于Oracle公司.MySQL是一种关联数据库管理系统,关联数据库将数据保存在不同的表中,而不是将所有数据放在一个大仓库内

Linux学习之CentOS--CentOS6.4下Mysql数据库的安装与配置【转】

如果要在Linux上做j2ee开发,首先得搭建好j2ee的开发环境,包括了jdk.tomcat.eclipse的安装(这个在之前的一篇随笔中已经有详细讲解了Linux学习之CentOS(七)--CentOS下j2ee环境搭建),如果要开发web项目,我们当然可以安装一个myeclipse到Linux系统上去,这个安装方法和安装eclipse完全相同,就没有记录下来了,有了jdk.tomcat.eclipse我们就已经能进行我们的程序开发了,但是如果要做一个项目,哪怕是小的不能再小的项目都离不开数