CentOS安装mysql遇到问题
2017-02-22 10:04
369 查看
安装完毕MYSQL服务在初始化数据库的时候报错
make报错
解决方法如下:
rm -fr ` find / -name mysql` ###删除所有安装的内容
rm -fr /application/mysql* ###删除安装路径的mysql
后重启linux 重新编译安装
安装成功,初始化数据库后的输出显示
echo 'PATH=/application/mysql/bin/:$PATH' >>/etc/profile
[root@mysql 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 重新编译安装
安装成功,初始化数据库后的输出显示
[root@mysql 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
相关文章推荐
- Centos 7.4 安装ipython和mysql-python遇到的问题
- 详解腾讯云CentOS7.0使用yum安装mysql及使用遇到的问题
- 阿里云centos7 安装mysql 5.7教程以及中间遇到的问题处理方法
- linux系统(阿里云机CentOs 6.3验证)mysql5.5安装及可能遇到问题
- CentOS下,yum安装mySql遇到的问题
- 腾讯云CentOS7.0使用yum安装mysql及使用遇到的问题
- 在Centos下用yum安装Mysql时遇到的问题
- 腾讯云CentOS7.0使用yum安装mysql及使用遇到的问题
- 在CentOS6.5中安装MySQL及遇到的问题Can't open the mysql.plugin table.
- 在Centos下用yum安装Mysql时遇到的问题
- 在虚拟机的CentOS上安装mysql遇到的问题
- CentOS 7 安装 MySQL 5.6遇到的各种问题小结
- (转)详解腾讯云CentOS7.0使用yum安装mysql及使用遇到的问题
- 腾讯云CentOS6.5下安装mysql,并配置好远程访问等权限,途中遇到的问题
- 在centos6.5下安装MySQL遇到的些许问题
- centos mysql安装遇到的问题及解决方法
- MySQL学习2_CentOS下安装MySQL遇到问题:Access denied for user 'root'@'localhost'
- CentOS6.5离线安装mysql遇到的几个问题
- 腾讯云服务器CentOS7.0安装JDK+Tomcat+MySQL详细步骤以及自己遇到的一些问题
- centos 安装mysql中遇到问题的解决办法