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

  • 相关阅读:
    C#获取本地IP地址
    C#中将字符串转换成数值
    JavaScript实现基于对象的双端队列
    Java网络编程
    JavaScript实现基于对象的队列
    JavaScript实现基于对象的栈
    JavaScript实现基于数组的栈
    发送短信按钮倒计时案例
    JavaScript动态显示时间
    html
  • 原文地址:https://www.cnblogs.com/SuperLiangG/p/4336188.html
Copyright © 2011-2022 走看看