sudo apt-get install -y mysql-server mysql-client
沒有候選版本
網上學習:https://cloud.tencent.com/developer/article/1611087
跟着教程一步一步安裝好了,但是mysql -u root -p 提示無mysql
解決辦法: touch ~/.bash_profile
export PATH=$PATH:/usr/local/mysql-8.0.26-linux-glibc2.12-x86_64/bin 這個文件夾中有一個mysql文件的
source ~/.bash_profile
好了,再次連接mysql又提示:mysql: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory
通過搜索,好像是版本不對。我通過這個Catfish 文件搜索(商店下載),找了到所有包含了libtinfo
然后將這個文件軟連接一下sudo ln -s /usr/lib/x86_64-linux-gnu/libtinfo.so.6.1 /usr/lib/x86_64-linux-gnu/libtinfo.so.5
登陸成功修改密碼
alter user 'root'@'localhost' identified by '123456';
啟動mysql cd /usr/local/mysql-8.0.19-linux-glibc2.12-x86_64/support-files sudo ./mysql.server start
開機啟動:
cp /usr/local/mysql-8.0.19-linux-glibc2.12-x86_64/support-files/mysql.server /etc/init.d/mysql cd /etc/rc2.d
sudo ln -s /etc/init.d/mysql S20mysql