windows子系统ubuntu18安装mysql

  • 卸载残余

    apt-get autoremove --purge mysql-server*
    apt-get remove mysql-server
    apt-get autoremove mysql-server
    apt-get remove mysql-common
    
  • 安装

    apt-get install mysql-server
    apt-get install mysql-client
    apt-get install libmysqlclient-dev
    
  • 修改用户的主目录

    usermod -d /var/lib/mysql/ mysql
    
  • 启动

    service mysql start
    
  • 停止

    service mysql stop
    
  • 重启

    service mysql restart
    
posted @ 2021-09-20 12:51  巫小诗  阅读(69)  评论(0编辑  收藏  举报