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