• 数据库连接&数据库进程&数据库操作


    root@webwall:/home/xiachengjiao# vi/webwall/mysql/my.cnf(看配置文件中的参数)

    root@webwall:/webwall/mysql/bin# ./mysql -u root -S /var/mysql1.sock -p

    Enter password: Enter password:********

    ERROR 2002 (HY000): Can't connect to local MySQL serverthrough socket '/var/mysql1.sock' (2)

    提示连不上数据库

    查找原因并解决

    ps -A |grep mysql查看数据库进程并没有开启

    xiachengjiao@webwall:/webwall/mysql/bin$sudo ./start.sh           开启数据库

    [sudo] password for xiachengjiao:123456

    ps -A |grep mysql  查看数据库进程是否开启,如下显示:

    5466 pts/1    00:00:00 mysqld_safe

     7420pxs/1    00:00:00 mysqld_safe

     7725pxs/1    00:00:00 mysqld

     7817pxs/1    00:00:00 mysqld

    提示数据库进程已经开启

    重新连接数据库

    root@webwall:/webwall/mysql/bin# ./mysql -uroot -S /var/mysql1.sock -p

    Enter password: Enter password:12wq12wq

    数据库操作如下:

    mysql> show databases;

    mysql> use new_db;

    mysql> show tables;

    mysql> use local;

    mysql> show tables;

    mysql> select * from ww_role_t;

    mysql> desc ww_role_t;

    mysql> insert into ww_role_t(rolename,roledescribe, systemrole, permission) values("test","test", 1, "1111110000001111");

    mysql> select * from ww_role_t;

    mysql> delete ww_role_t where rolename ="test";

    如果有一天我们淹没在茫茫人海中,庸碌一生,那一定是我们没有努力活得丰盛
  • 相关阅读:
    前端大文件分片上传/多线程上传
    网页大文件分片上传/多线程上传
    docker基础入门之二
    linux之iptable
    linux内核之网络协议栈
    ubuntu之iptables
    c++栈管理库TCMalloc、jeMalloc
    curl之post提交xml
    ceph基本操作整理
    docker基础入门之一
  • 原文地址:https://www.cnblogs.com/xiachj/p/3792285.html
Copyright © 2020-2023  润新知