error: RPC failed; curl 18 transfer closed with outstanding read data remaining fatal: The remote end hung up unexpectedly fatal: early EOF fatal: index-pack failed
mysql -h <host> -u <user> -p<passwd> mysql -h <host> -u <user> -p Enter password: ******** mysql -u user -p mysql mysql -h <host> -u <user> -p <Database>
查询
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
SELECT*FROMtable SELECT*FROM table1, table2, ... SELECT field1, field2, ... FROM table1, table2, ... SELECT ... FROM ... WHEREcondition SELECT ... FROM ... WHEREconditionGROUPBY field SELECT ... FROM ... WHEREconditionGROUPBY field HAVING condition2 SELECT ... FROM ... WHEREconditionORDERBY field1, field2 SELECT ... FROM ... WHEREconditionORDERBY field1, field2 DESC SELECT ... FROM ... WHEREcondition LIMIT 10 SELECTDISTINCT field1 FROM ... SELECTDISTINCT field1, field2 FROM ...
SELECT ... FROM t1 JOIN t2 ON t1.id1 = t2.id2 WHEREcondition SELECT ... FROM t1 LEFTJOIN t2 ON t1.id1 = t2.id2 WHEREcondition SELECT ... FROM t1 JOIN (t2 JOIN t3 ON ...) ON ... SELECT ... FROM t1 JOIN t2 USING(id) WHEREcondition
条件
1 2 3 4 5 6 7 8 9
field1 = value1 field1 <> value1 field1 LIKE'value _ %' field1 ISNULL field1 ISNOTNULL field1 IN (value1, value2) field1 NOTIN (value1, value2) condition1 AND condition2 condition1 OR condition2
UPDATE table1 SET field1=new_value1 WHEREcondition -- join: UPDATE table1, table2 SET field1=new_value1, field2=new_value2, ... WHERE table1.id1 = table2.id2 ANDcondition
浏览
1 2 3 4 5 6 7 8 9 10 11
SHOW DATABASES SHOW TABLES SHOW FIELDS FROMtable/SHOW COLUMNS FROMtable/DESCRIBEtable/DESCtable/ EXPLAIN table SHOWCREATETABLEtable SHOWCREATETRIGGERtrigger SHOW TRIGGERS LIKE'%update%' SHOW PROCESSLIST KILL process_number SELECT table_name, table_rows FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA ='**yourdbname**'; $ mysqlshow $ mysqlshow database
数据库 CRUD
1 2 3 4 5 6
CREATE DATABASE [IF NOTEXISTS] mabase [CHARACTERSET charset] [COLLATEcollation] CREATE DATABASE mabase CHARACTERSET utf8 DROP DATABASE mabase USE mabase
GRANTALL PRIVILEGES ON base.*TO'user'@'localhost' IDENTIFIED BY'password'; GRANTSELECT, INSERT, DELETEON base.*TO'user'@'localhost' IDENTIFIED BY'password'; REVOKEALL PRIVILEGES ON base.*FROM'user'@'host'; -- one permission only REVOKEALL PRIVILEGES, GRANT OPTION FROM'user'@'host'; -- all permissions
SET PASSWORD = PASSWORD('new_pass') SET PASSWORD FOR'user'@'host'= PASSWORD('new_pass') SET PASSWORD = OLD_PASSWORD('new_pass')
DROPUSER'user'@'host'
-- MySQL 分配权限时, 只支持库名的模糊匹配不支持表名的模糊匹配,可以用下面的 SQL 来生成批量的授权语句 SELECT CONCAT('GRANT update, insert ON myDB.', TABLE_NAME, ' to ''user'';') grantSQL FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA ='myDB'and TABLE_NAME like'MyTable%';
忘记 root 密码
1 2 3 4 5 6
$ /etc/init.d/mysql stop $ mysqld_safe --skip-grant-tables & $ mysql # on another terminal mysql> UPDATE mysql.user SET password=PASSWORD('nouveau') WHERE user='root'; ## Kill mysqld_safe from the terminal, using Control + \ $ /etc/init.d/mysql start
self.initDropDownBox = function(box, editor){ var dropDown = this, datePicker = dropDown.get("box.control"); if (datePicker) { var date = editor.get("value"); var year, month; if (typeof date == "string") { date = newDate(date); } else { if (!(date instanceofDate)) { date = newDate(); } } datePicker.set("date", date); } };
Initialization of bean failed; nested exception is java.lang.NoSuchMethodError: com.bstek.bdf2.core.context.ContextHolder.getApplicationContext()Lorg/springframework/web/context/WebApplicationContext;