日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > 数据库 >内容正文

数据库

mysql编译安装后目录空_MySQL源码安装完成后修改安装路径启动问题

發(fā)布時間:2023/12/10 数据库 41 豆豆
生活随笔 收集整理的這篇文章主要介紹了 mysql编译安装后目录空_MySQL源码安装完成后修改安装路径启动问题 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

在Linux上源碼編譯安裝完mysql后,又將安裝的路徑進行了修改,但是發(fā)現(xiàn)在設置后環(huán)境變量后啟動報錯,如下:

[root@HServer_03 var]# mysqld_safe --user=mysql &

[1] 31248

[root@HServer_03 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 http://dev.mysql.com/doc/mysql/en/mysqld-safe.html 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-medium.cnf /etc/my.cnf

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

現(xiàn)在將/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

在啟動時出現(xiàn)上述錯誤的主要原因是mysql在編譯安裝時,將路徑/opt/mysql5156寫入了mysql/bin/mysqld_safe腳本中,打開該腳本可以明確看到各個啟動邏輯的判斷都有/opt/mysql5156的影子,那么將所有的/opt/mysql5156 全局替換為/usr/local/mysql,保存后重新啟動,ok了。

另外由于這次的編譯安裝時采用動態(tài)編譯的,還需要修改mysql的動態(tài)函式庫,

Shell>vi /etc/ld.so.conf

/usr/local/mysql/lib/mysql/

Shell>ldconfig

這樣在新的路徑下,編譯安裝的mysql就可以無礙使用了。

創(chuàng)作挑戰(zhàn)賽新人創(chuàng)作獎勵來咯,堅持創(chuàng)作打卡瓜分現(xiàn)金大獎

總結

以上是生活随笔為你收集整理的mysql编译安装后目录空_MySQL源码安装完成后修改安装路径启动问题的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。