700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > 树莓派如何卸载mysql_树莓派安装MySQL数据库与卸载

树莓派如何卸载mysql_树莓派安装MySQL数据库与卸载

时间:2021-06-04 10:47:32

相关推荐

树莓派如何卸载mysql_树莓派安装MySQL数据库与卸载

出处:

1、/liyangLife/p/4500115.html

2、/huayucong/article/details/49736427

3、/article/23132?block_id=tuijian_wz

4、/mysql/mysql-install.html(Debian系统)

5、/faryang/article/details/50788795(树莓派系统)

删除mysql:

sudo apt-ge autoremove --purge mysql-server

sudo apt-get remove mysqyl-server

sudo apt-get autoremove mysql-server

sudo apt-get remove mysql-common //重要

清除残留数据

dpkg -l |grep ^rc|awk '{print $2}' |sudo xargs dpkg -P

安装Mysql软件

sudo apt-get install mysql-server

sudo apt-get install mysql-client

sudo apt-getinstall mysql-server python-mysqldb //安装python接口的mysql

测试:

没有找到bind_address信息

安装正常后,设置防火墙时,port 22端口没有开启成功,结果reboot树莓派后,不能ssh登陆了,尴尬,

重新ufw allow 22端口后,才可以登陆ssh。

再次使用Mysql时,

Mysql -u root -p

出现“mysql access denied for user 'root'@'localhost'”

幸好找到方法:

step 1 ://首先停止当前的mysql服务:/etc/init.d/mysql stop(service mysqld stop)

step 2: //设置Mysql免密登录,等同恢复初始时的状态 (  ̄  ̄)σ…( _ _)ノ|壁sudo mysqld_safe--skip-grant-tables&

step 3: //另外开个终端://进入mysql并且以root账户进入“mysql”数据库

sudo mysql--user=root mysql update user setPassword=PASSWORD('new-password');

flush privileges;

exit;

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。