Database connections & Database processes & Database operations

Source: Internet
Author: User

[Email protected]:/home/xiachengjiao# vi/webwall/mysql/my.cnf(see parameters in config file)

[Email protected]:/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)

Prompt to not connect to the database


Find causes and resolve

Ps-a |grep MySQL view database process is not turned on

[Email protected]:/webwall/mysql/bin$sudo./start.sh Open Database

[sudo] password for xiachengjiao:123456

Ps-a |grep MySQL to see if the database process is turned on, as shown below:

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

Prompt the database process is already open


Reconnect the database

[Email protected]:/webwall/mysql/bin#./mysql-uroot-s/var/mysql1.sock-p

Enter Password:enter Password:12wq12wq


The database operations are as follows:

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";


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.