CentOS安装mysql遇到问题

安装完毕MYSQL服务在初始化数据库的时候报错

[[email protected] mysql]# /application/mysql/bin/mysql_install_db --basedir=/application/mysql/ --datadir=/application/mysql/data/ --user=mysql
FATAL ERROR: Could not find errmsg.sys
The following directories were searched:
    /application/mysql//share/english
    /application/mysql//share/mysql/english
If you compiled from source, you need to run ‘make install‘ to
copy the software into the correct location ready for operation.
If you are using a binary release, you must either be at the top
level of the extracted archive, or pass the --basedir option
pointing to that location.

打算重新编译重新 ./configure是正常的,但是一到make的时候就报错,如下

make报错

mysql.cc:1040: error: redefinition of ‘struct _hist_entry’
../include/readline/readline.h:55: error: previous definition of ‘struct _hist_entry’
mysql.cc:1043: error: invalid type in declaration before ‘;’ token
mysql.cc:1043: error: conflicting declaration ‘typedef int HIST_ENTRY’
../include/readline/readline.h:58: error: ‘HIST_ENTRY’ has a previous declaration as ‘typedef struct _hist_entry HIST_ENTRY’
mysql.cc: In function ‘void initialize_readline(char*)’:
mysql.cc:2455: error: ‘rl_completion_func_t’ was not declared in this scope
mysql.cc:2455: error: expected primary-expression before ‘)’ token
mysql.cc:2456: error: invalid conversion from ‘char* (*)(const char*, int)’ to ‘int (*)(const char*, int)’
mysql.cc:2458: error: invalid conversion from ‘int (*)(int, int)’ to ‘int (*)(const char*, int)’
mysql.cc:2458: error:   initializing argument 2 of ‘int rl_add_defun(const char*, int (*)(const char*, int), int)’
make[2]: *** [mysql.o] Error 1
make[2]: Leaving directory `/home/admin/tools/mysql-5.1.62/client‘
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/admin/tools/mysql-5.1.62/client‘
make: *** [all-recursive] Error 1

经过不懈奋斗,发现是由于第一次安装的时候,./configure make 之后忘记make install。又重新编译了

解决方法如下:

rm -fr ` find / -name mysql`   ###删除所有安装的内容

rm -fr /application/mysql*    ###删除安装路径的mysql

后重启linux 重新编译安装

安装成功,初始化数据库后的输出显示

[[email protected] mysql]#  /application/mysql/bin/mysql_install_db --basedir=/application/mysql --datadir=/application/mysql/data/ --user=mysql
Installing MySQL system tables...
170222  8:50:13 [Warning] ‘--skip-locking‘ is deprecated and will be removed in a future release. Please use ‘--skip-external-locking‘ instead.
OK
Filling help tables...
170222  8:50:13 [Warning] ‘--skip-locking‘ is deprecated and will be removed in a future release. Please use ‘--skip-external-locking‘ instead.
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:
/application/mysql/bin/mysqladmin -u root password ‘new-password‘
/application/mysql/bin/mysqladmin -u root -h mysql password ‘new-password‘
Alternatively you can run:
/application/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 /application/mysql ; /application/mysql/bin/mysqld_safe &
You can test the MySQL daemon with mysql-test-run.pl
cd /application/mysql/mysql-test ; perl mysql-test-run.pl
Please report any problems with the /application/mysql/scripts/mysqlbug script!

配置mysql默认配置和init.d启动

cp support-files/my-small.cnf /etc/my.cnf 
cp support-files/mysql.server /etc/init.d/
chmod +x /etc/init.d/mysql.server 
mv /etc/init.d/mysql.server /etc/init.d/mysqld
/etc/init.d/mysqld start

最后配置PATH

echo ‘PATH=/application/mysql/bin/:$PATH‘ >>/etc/profile

时间: 2025-01-01 06:10:47

CentOS安装mysql遇到问题的相关文章

CentOS安装MySQL问题汇总

遇到的错误 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) denied for user 'root'@'localhost' (using password: NO) 描述:刚安装完MySQL,第一次登陆. [[email protected] ~]$ mysql -u root -p Enter password: #我记得root初始是没密码的,这句直接回车 ERROR

centos 安装mysql 5.5.12

1.安装gcc-c++  gcc make cmake编译器 2.安装ncurses 3.添加用户组 groupadd mysql useradd -r -g mysql mysql 4.安装 tar -zxvf mysql-5.5.12.tar.gz cd mysql-5.5.12 cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_UNIX_ADDR=/data/mysql/mysql.sock -DDEFAULT_CHARSET=ut

虚拟机centos安装mysql遇到 Couldn‘t resolve host ‘mirror

网上查了一下说是DNS服务器错误.于是修改一下 /etc/resolv.conf添加一个nameserver 8.8.8.8完成虚拟机centos安装mysql遇到 Couldn't resolve host 'mirror安装MySql server:1.下载安装 yum install -y mysql-server2.服务开启 service mysqld start3.服务随开机启动 chkconfig mysqld on4.进入mysql mysql exit5.安装连接 yum in

linix (Centos) 安装 mysql

Linux(centos)安装mysql 数据库 卸载原先数据库 1.  查询系统有没有安装数据库 rpm -qa | grep mysql 2.卸载原先的数据库 rpm -e mysql // 普通删除模式  rpm -e --nodeps mysql // 强力删除模式,如果使用上面命令删除时,提示有依赖的其它文件,则用该命令可以对其进行强力删除 使用yum 安装数据库 1.查询yum提供的数据库版本 yum list | grep mysql 2.安装数据库 yum install  -y

Centos 安装mysql

CentOs中mysql的安装与配置[转] 在linux中安装数据库首选MySQL,Mysql数据库的第一个版本就是发行在Linux系统上,其他选择还可以有postgreSQL,oracle等 在Linux上安装mysql数据库,我们可以去其官网上下载mysql数据库的rpm包,http://dev.mysql.com/downloads/mysql/5.6.html#downloads,大家可以根据自己的操作系统去下载对应的数据库文件 这里我是通过yum来进行mysql数据库的安装的,通过这种

1.centOS安装Mysql

上个星期研究了一个星期的Mysql,从今天起把学到的东西整理一下. ---------------------------------------------- mysql安装本人亲试过两种安装方式,一种rpm方式,一种绿色方式安装,个人感觉rpm方式最方便 1.rpm方式 1)需要的软件包:(5.5为例,https://dev.mysql.com/downloads/mysql/5.5.html#downloads) MySQL-client-5.5.48-1.linux2.6.i386.rp

centos安装mysql数据库

a.镜像自带安装 1.查看系统mysql rpm -qa | grep mysql 2.强制卸载历史版本 rpm -e --nodeps mysql 3.查看yum源下提供的msyql yum list | grep mysql 4.执行安装 yum install -y mysql-server mysql mysql-devel rpm -qi mysql-server 5.启动 service mysqld start 6.修改为开机自启动 chkconfig --list | grep

CentOS 安装MySQL(rpm)提示错误Header V3 DSA/SHA1 Signature

提示错误:Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY error: Failed dependencies 错误原因:这是由于yum安装了旧版本的GPG keys造成的 解决办法:后面加上--force --nodeps 原文: 摘要: CentOS安装rpm安装MySQL时爆出警告: 警告:mysql-server-5.5.46-1.linux2.6.x86_64.rpm: 头V3 DSA/SHA1 Signature, 密钥 ID

centos 安装mysql密码修改后还是不能连接的原因

centos 上安装mysql密码修改后还是不能连接出现错误:ERROR 1142 (42000): SELECT command denied to user ''@'localhost' for table 'user' 解决方法: 1.退出mysql mysql> quit; Bye 2.执行下面语句 [[email protected] 桌面]# mysqld_safe --skip-grant-table 3.删除空用户 mysql -uroot  mysql delete from

CentOS安装mysql*.rpm提示conflicts with file from package的解决办法

CentOS 6.5下安装MySql 5.6 解压文件:tar xvf MySQL-5.6.19-1.linux_glibc2.5.x86_64.rpm-bundle.tar 释放出以下文件: MySQL-embedded-5.6.19-1.linux_glibc2.5.x86_64.rpmMySQL-devel-5.6.19-1.linux_glibc2.5.x86_64.rpmMySQL-shared-compat-5.6.19-1.linux_glibc2.5.x86_64.rpmMySQ