zoukankan      html  css  js  c++  java
  • mysql数据库问题

    一,给root用户添加密码

    遇到的问题
    
    
     /usr/local/mysql5/bin/mysqladmin -u root -p password root
    Enter password:
    /usr/local/mysql5/bin/mysqladmin: connect to server at 'localhost' failed
    error: 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)'
    Check that mysqld is running and that the socket: '/tmp/mysql.sock' exists!
    

     

    问题2

    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
    

      

    二,通过终端链接seqserver

    /usr/local/mysql/bin/mysql -u root -p
    

     

    三,通过终端启动或关闭mysql

    1.sudo/Library/StartupItems/MySQLCOM/MySQLCOM start
    
    2.sudo/Library/StartupItems/MySQLCOM/MySQLCOM stop

    sudo/Library/StartupItems/MySQLCOM/MySQLCOM [start |stop | restart]

    四,解决方案

    卸载,重装。5.7.

    cd /usr/local/mysql/bin
    
    ./mysql -u root -p
    
    enter password:自动生成的密码输入
    
    进入数据库
    SET PASSWORD = PASSWORD('root');
    
    新建数据库
    create database cAuth;
    

      完美解决以上问题。

     五

    mysql -u root -p;

    use cAuth;

    show tables;
    create database test;

    select * from cSessionInfo;

      建表

    create table test(id int,name varchar(100));  

    查看表

    select * from test;
    
    show tables;
    desc cSessionInfo;

    select create_time,open_id from cSessionInfo;

      删除表

    show tables;
    
    drop table test;
    

      

     npm install wafer2-client-sdk --save  

    npm install sass-loader node-sass -save-dev

  • 相关阅读:
    2018-08-07
    2018-08-06
    2018-08-03
    安装mysql
    iOS-----------关于组件化
    QQ路径
    iOS----------viewcontroller中的dealloc方法不调用
    【2020Python修炼记】前端开发之 JavaScript 的 BOM 和 DOM 操作
    【2020Python修炼记】前端开发之 JavaScript 内置方法
    【2020Python修炼记】前端开发之 JavaScript 函数
  • 原文地址:https://www.cnblogs.com/catherine007/p/9675132.html
Copyright © 2011-2022 走看看