zoukankan      html  css  js  c++  java
  • 在Ubuntu上安装Mysql

    安装mysql server:

    1、  sudo apt-get install mysql-server

    2、  如果出现Unable to locate package……,执行sudo apt-get update,然后再执行sudo apt-get upgrade,再执行sudo apt-get install mysql-server

    3、  进入mysql命令窗口,需要输入mysql  -h localhost –u root –p

    4、  接着输入安装时的密码

    5、  创建用户CREATE USER 'guo.liang'@'localhost' IDENTIFIED BY '851220';

    6、  授权GRANT ALL ON cookbook.* TO 'guo.liang'@'localhost';

    安装mysql workbench客户端:

    1、  sudo apt-get install mysql-client

    2、  sudo apt-get install mysql-workbench

    运行mysql workbench:

    1、  whereis mysql-workbench  查找在那个目录

    2、  /usr/bin/mysql-workbenth 运行mysql workbench


    Starting, Stopping and Restarting MySQL on Ubuntu

    To start, stop, and restart the MySQL service on Ubuntu, you can use the /etc/init.d/mysql script.

    You need to ssh to your Pod as root, or use sudo command. Here are each of the commands:

    Start:

    root@mypod:~# sudo /etc/init.d/mysql start

    Stop:

    root@mypod:~# sudo /etc/init.d/mysql stop

    Restart:

    root@mypod:~# sudo /etc/init.d/mysql restart

     
     

    A different way to do this, is to use “upstart” (which is what /etc/init.d/mysql links to) which works as follows:

    Start:

    root@mypod:~# sudo start mysql

    Stop:

    root@mypod:~# sudo stop mysql

    Restart:

    root@mypod:~# sudo restart mysql

  • 相关阅读:
    golang linux安装
    vscode 插件
    windows访问eks pods
    go mod包管理
    beego创建项目
    Atcoder ARC-125
    AtCoder AGC003 简要题解
    Python 字符串转成变量名
    13_Go基础(binary)
    12_Go基础(iota)
  • 原文地址:https://www.cnblogs.com/SuperLiangG/p/4336188.html
Copyright © 2011-2022 走看看