总体安装过程可以参考:https://blog.csdn.net/studio_1/article/details/128345934或https://blog.csdn.net/weixin_44572623/article/details/131418933,博主亲测有效
1、mysql文件夹存放路径
可以自己设定,不一定非要是/usr/local,只是要注意后续根据实际存放路径修改一些安装路径
========================================================================
2、执行命令报错:Permission denied
利用sudo执行命令:如要执行apt-get update,可以执行sudo apt-get update
========================================================================
3、添加服务时执行chkconfig --add mysql, 报错chkconfig: command not found
可参考:https://blog.csdn.net/qq_42728267/article/details/132353628
如果在过程中执行sudo apt-get install sysv-rc-conf遇到报错如下:
E: Unable to locate package sysv-rc-conf
这有可能是因为无法定位软件包 sysv-rc-conf,需要添加镜像源,可参考上述链接的步骤
如果因为未添加密钥报错:“http://archive.ubuntu.com/ubuntu trusty Release: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5 NO_PUBKEY 3B4FE6ACC0B21F32”
可参考:https://blog.csdn.net/ayunnuo/article/details/119138489, 添加密钥
========================================================================
4、当安装sysv-rc-conf时最终报错E: Sub-process /usr/bin/dpkg returned an error code (1)
不要着急,建议你在执行一遍apt-get install sysv-rc-conf命令,看是否出现“sysv-rc-conf is already the newest version (0.99-7)”,如果出现这句话,意味着你其实已经安装成功,如图。
如不成功,需要根据报错继续搜索答案。
========================================================================
5、执行chkconfig --add mysql报错:Unknown option: add
这一步属于正常,继续执行chkconfig mysqld on,然后往下继续步骤即可
6、启动MySQL执行service mysql start,报错:Failed to start mysql.service: Unit mysql.service not found.
可以尝试找到init.d文件夹(一般在/etc/init.d位置),然后修改执行: sudo /etc/init.d/mysgl start