ubuntu彻底删除mysql 然后 手动安装mysql 压缩后的二进制包

前端之家收集整理的这篇文章主要介绍了ubuntu彻底删除mysql 然后 手动安装mysql 压缩后的二进制包前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
删除 MysqL

sudo apt-get autoremove --purge MysqL-server-5.0
sudo apt-get remove MysqL-server
sudo apt-get autoremove MysqL-server
sudo apt-get remove MysqL-common //这个很重要

上面的其实有一些是多余的。

下载对应的Linux安装包,注意32位与64位的区别,然后放到/home/ubuntu

解压 tar -xzf *tar.gz

我不新建用户,直接用系统默认的ubuntu安装

解压后,/home/ubuntu/MysqL-5.5.56-linux-glibc2.5-i686
改变目录的所有者
sudo chown -R ubuntu:ubuntu /home/ubuntu/MysqL-5.5.56-linux-glibc2.5-i686

安装共享库libaio1

sudo apt-get install libaio1

进入目录/home/ubuntu/MysqL-5.5.56-linux-glibc2.5-i686

试图安装:./scripts/MysqL_install_db --user=ubuntu

会发现根本不行,

To start MysqLd at boot time you have to copy
support-files/MysqL.server to the right place for your system

于是,

cd /etc/init.d
sudo ln -s /home/ubuntu/MysqL-5.5.56-linux-glibc2.5-i686/support-files/MysqL.server
sudo /etc/init.d/MysqL.server start

/etc/init.d/MysqL.server: my_print_defaults: not found

sudo cp /home/ubuntu/MysqL-5.5.56-linux-glibc2.5-i686/bin/my_print_defaults /usr/bin

还是不行,找到my.cnf

MysqLd --verbose --help|grep my.cnf
2016-05-31 16:36:09 0 [Note] MysqLd (MysqLd 5.6.30-log) starting as process 3379 ...
2016-05-31 16:36:09 3379 [Note] Plugin 'FEDERATED' is disabled.
/etc/my.cnf /etc/MysqL/my.cnf /usr/local/MysqL/etc/my.cnf ~/.my.cnf
my.cnf,$MysqL_TCP_PORT,/etc/services,built-in default
可以看到MysqLd会去读取以上路径,于是复制

sudo cp /home/ubuntu/MysqL-5.5.56-linux-glibc2.5-i686/support-files/my-small.cnf /usr/local/MysqL/my.cnf

sudo cp -r /home/ubuntu/MysqL-5.5.56-linux-glibc2.5-i686/* /etc/MysqL/

sudo chmod -R 777 /usr/local/MysqL

sudo chown -r ubuntu:ubuntu /usr/local/MysqL

sudo /etc/init.d/MysqL.server start

Warning: World-writable config file '/usr/local/MysqL/my.cnf' is ignored

Failed to issue method call: Unit MysqL.service Failed to load: No such file or directory. See system logs and 'systemctl status MysqL.service' for details.

systemctlenableMysqL.server
Warning: World-writable config file '/etc/my.cnf' is ignored

查看my.cnf的权限

ls -l /etc/my.cnf

- rwxrwxrwx 1 root root 4878 Jul 30 11 : 31 / etc / my . cnf

修复MysqL问题

chmod 644 /etc/my.cnf

关闭MysqL

MysqL关闭成功.问题很简单

sudo service MysqL.server start

sudo service MysqL.server stop

ln -s /usr/local/MysqL/data/MysqL.sock /var/run/MysqLd/MysqLd.sock

原文链接:https://www.f2er.com/ubuntu/352388.html

猜你在找的Ubuntu相关文章