啟動(dòng)mysql 失敗,“Warning:The /usr/local/mysql/data directory is not owned by the 'mysql' or '_mysql' ”
一、Mac OS X的升級(jí)或其他原因可能會(huì)導(dǎo)致MySQL啟動(dòng)或開(kāi)機(jī)自動(dòng)運(yùn)行時(shí)
在MySQL操作面板上會(huì)提示“Warning:The /usr/local/mysql/data directory is not owned by the 'mysql' or '_mysql' ”,
這應(yīng)該是某種情況下導(dǎo)致/usr/local/mysql/data的宿主發(fā)生了改變,
只需要運(yùn)行“sudo chown -R mysql /usr/local/mysql/data”即可
mac 下面運(yùn)行 “sudo chown -R _mysql:wheel /usr/local/mysql/data”
終端指令
mysql -u root -p
mysql 常用指令
show databases;
drop database sys;
use sys;
select database();
show tables;
表操作:
desc para5;顯示para5結(jié)構(gòu)
select *from para5;查詢para5表
insert into para5 values(4,'yrg','22’);//插入數(shù)據(jù)
delete from para5 where id=6;//刪除數(shù)據(jù)
alter table para5 add sex varchar(20) NOT NULL default '0'; 新增字段
XPath庫(kù) 知識(shí)點(diǎn)
<?xml version="1.0" encoding="ISO-8859-1"?>
<bookstore>
<book>
<title lang="en">Harry Potter</title>
<author>J K. Rowling</author>
<year>2005</year>
<price>29.99</price>
</book>
</bookstore>
節(jié)點(diǎn)關(guān)系 <book> 是 title author year price的父節(jié)點(diǎn) parent
title author year price 是<book>的子節(jié)點(diǎn) children
title author year price 是同胞節(jié)點(diǎn) Sibling
book bookstore 是title author year price的先輩節(jié)點(diǎn)Ancestor
title author year price 是book bookstore的后代節(jié)點(diǎn)Descendant
XPath語(yǔ)法
re庫(kù) 正則表達(dá)式
# '\d+'匹配數(shù)字字符
# '\s+'匹配空白字符
# '\S+'匹配非空白字符
# '\w+'匹配單詞字符[A-Za-z0-9]
# '\W+'匹配非單詞字符[A-Za-z0-9]
# '^one'匹配字符串開(kāi)頭
# 'our4$'匹配字符串結(jié)尾