source方式安裝mysql的時(shí)候,出現(xiàn)了Could not find ./share/fill_help_tables.sql的問題:
# /usr/local/mysql/scripts/mysql_install_db --root=mysql basedir=/usr/local/mysql/ --datadir=/mnt/data/
FATAL ERROR: Could not find ./share/fill_help_tables.sql
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.
我反復(fù)試了好幾遍,發(fā)現(xiàn)都不行。google去看了下,別人是手動(dòng)把*.sql復(fù)制到/share/目錄下的。
想了好久才意識(shí)到,是執(zhí)行命令的不對(duì)啊。。。
所以這應(yīng)該是阿里云的文檔有個(gè)小錯(cuò)誤吧。
按照阿里云的步驟
(https://help.aliyun.com/document_detail/50700.html?spm=5176.doc53077.6.712.dJ7ieO),安裝mysql時(shí) 第6步初始化數(shù)據(jù)庫(kù),是cd到/usr/local/src/mysql-5.6.24/目錄下,然后再去執(zhí)行 “/usr/local/mysql/scripts/mysql_install_db --user=mysql --datadir=/mnt/data/ ”命令。
但是實(shí)際上這是不對(duì)的,應(yīng)該是在mysql的安裝目錄下去執(zhí)行命令,也就是要cd到/usr/local/mysql/下,然后再去執(zhí)行初始化的命令。
當(dāng)然了,這可能跟版本有關(guān)系。
此外,若是你加上basedir=安裝目錄,應(yīng)該也有效;
就這問題弄了幾個(gè)小時(shí)了。。。唉