700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > MySQL源码安装完成后修改安装路径启动问题

MySQL源码安装完成后修改安装路径启动问题

时间:2021-12-15 14:23:34

相关推荐

MySQL源码安装完成后修改安装路径启动问题

数据库|mysql教程

MySQL教程,MySQL源码安装完成后修改安装路径启动问题

数据库-mysql教程

帝国程序导航网站源码,ubuntu:mpi的安装,耳朵里爬虫子,php redis 定时,seo使用cdnlzw

在Linux上源码编译安装完mysql后,又将安装的路径进行了修改,但是发现在设置后环境变量后启动报错,如下:[root@www.linuxidc.c

单页网站平台源码下载,Ubuntu查看vnc版本,tomcat7关闭端口,爬虫抓取广告,一美元等于多少php,seo年费lzw

qq个人站源码下载,ubuntu安装点不了,tomcat7是绿色软件,爬虫代码学习推荐,php用哪一个软件,seo连接查找lzw

在Linux上源码编译安装完mysql后,又将安装的路径进行了修改,但是发现在设置后环境变量后启动报错,如下:

[root@ var]# mysqld_safe –user=mysql &

[1] 31248

[root@ var]# 110422 11:04:00 mysqld_safe Logging to ‘/opt/mysql5156/var/HServer_03.err’.

touch: cannot touch `/opt/mysql5156/var/HServer_03.err’: No such file or directory

chown: cannot access `/opt/mysql5156/var/HServer_03.err’: No such file or directory

110422 11:04:00 mysqld_safe The file /opt/mysql5156/libexec/mysqld

does not exist or is not executable. Please cd to the mysql installation

directory and restart this script from there as follows:

./bin/mysqld_safe&

See for more information

/usr/local/mysql/bin/mysqld_safe: line 100: /opt/mysql5156/var/HServer_03.err: No such file or directory

[1]+ Exit 1 mysqld_safe –user=mysql

按照提示原有的路径目录不存在,需要到mysql的相对路径下启动~

我的原安装路径是在/opt/mysql5156下,具体的安装过程:

Shell> tar –zxvvf mysql-5.1.56.tar.gz

Shell> cd mysql-5.1.56

Shell> ./configure –prefix=/opt/mysql5156 \

–with-charset=utf8 –with-collation=utf8_general_ci \

–with-extra-charsets=latin1,gb2312 \

–with-plugins=innobase,innodb_plugin,myisam,heap,csv,federated,blackhole \

–enable-local-infile –enable-thread-safe-client

Shell> make

Shell >make install

Shell> cp support-files/my-f /etc/f

Shell>cd /opt/mysql5156

Shell>chown –R mysql .

Shell>chgrp –R mysql .

Shell>bin/mysql_install_db –user=mysql

Shell>chown –R root .

Shell> chown –R mysql var

Shell>vi /root/.bash_profile

PATH=$PATH:$HOME/bin:/opt/mysql5156/bin

现在将/opt/mysql5156/目录移动到/usr/local/下:

Shell>mv /opt/mysql5156 /usr/local/mysql

Shell>vi /root/.bash_profile

PATH=$PATH:$HOME/bin:/usr/local/mysql/bin

Shell>source /root/.bash_profile

在启动时出现上述错误的主要原因是mysql在编译安装时,将路径/opt/mysql5156写入了mysql/bin/mysqld_safe脚本中,打开该脚本可以明确看到各个启动逻辑的判断都有/opt/mysql5156的影子,,那么将所有的/opt/mysql5156 全局替换为/usr/local/mysql,保存后重新启动,ok了。

另外由于这次的编译安装时采用动态编译的,还需要修改mysql的动态函式库,

Shell>vi /etc/ld.so.conf

/usr/local/mysql/lib/mysql/

Shell>ldconfig

这样在新的路径下,编译安装的mysql就可以无碍使用了。

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。