zoukankan      html  css  js  c++  java
  • 树莓派安装MySQL数据库与卸载

    出处:

    1、http://www.cnblogs.com/liyangLife/p/4500115.html

    2、https://blog.csdn.net/huayucong/article/details/49736427

    3、https://www.imooc.com/article/23132?block_id=tuijian_wz

    4、http://www.runoob.com/mysql/mysql-install.html(Debian系统)

    5、https://blog.csdn.net/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-get install 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 set Password=PASSWORD('new-password'); 

    flush privileges;

    exit; 

     

  • 相关阅读:
    puppeteer,新款headless chrome!
    圣诞快乐,而且写博客有两年了~
    es2015及es2017对我们的编程方式造成了什么影响?
    Redis的安装和部署
    ActiveMQ5.0实战三:使用Spring发送,消费topic和queue消息
    hsweb 企业后台管理基础框架
    通过Spring Session实现新一代的Session管理
    mod_pagespeed
    unusedjs
    apache模块 合并多个js/css 提高网页加载速度
  • 原文地址:https://www.cnblogs.com/anyiz/p/10657213.html
Copyright © 2011-2022 走看看