- 去官网上下载.tar.gz文件(5.5版本)
- 照着官网教程执行命令https://dev.mysql.com/doc/refman/5.5/en/binary-installation.html
shell> apt-get install libaio1 # install library
shell> groupadd mysql
shell> useradd -r -g mysql -s /bin/false mysql
shell> cd /usr/local
shell> tar zxvf /path/to/mysql-VERSION-OS.tar.gz
shell> ln -s /usr/local/mysql-5.5.62-linux-glibc2.12-x86_64/ mysql #自己填的路径 不知道对不对
shell> cd mysql
shell> chown -R mysql .
shell> chgrp -R mysql .
shell> scripts/mysql_install_db --user=mysql
shell> chown -R root .
shell> chown -R mysql data
# Next command is optional
shell> cp support-files/my-medium.cnf /etc/my.cnf
shell> bin/mysqld_safe --user=mysql &
# Next command is optional
shell> cp support-files/mysql.server /etc/init.d/mysql.server
安装完之后有点问题 在进行这一步时报错:
报错信息:
‘Access denied for user ‘root’@‘localhost’ (using password: NO)’
并且在shell里输入mysql找不到命令,推测可能是软链接那里有问题,导致安装位置错了。先凑合用着,实在不行再卸载重装吧:
https://blog.csdn.net/machao0903/article/details/78407676
参考了一篇博客,终于能够正常打开mysql了,不过可能还存在很多问题,先不管了。
https://blog.csdn.net/bastengao/article/details/84010414