启动mysql 失败,“Warning:The /usr/local/mysql/data directory is not owned by the 'mysql' or '_mysql' ”
一、Mac OS X的升级或其他原因可能会导致MySQL启动或开机自动运行时
在MySQL操作面板上会提示“Warning:The /usr/local/mysql/data directory is not owned by the 'mysql' or '_mysql' ”,
这应该是某种情况下导致/usr/local/mysql/data的宿主发生了改变,
只需要运行“sudo chown -R mysql /usr/local/mysql/data”即可
mac 下面运行 “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结构
select *from para5;查询para5表
insert into para5 values(4,'yrg','22’);//插入数据
delete from para5 where id=6;//删除数据
alter table para5 add sex varchar(20) NOT NULL default '0'; 新增字段
XPath库 知识点
<?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>
节点关系 <book> 是 title author year price的父节点 parent
title author year price 是<book>的子节点 children
title author year price 是同胞节点 Sibling
book bookstore 是title author year price的先辈节点Ancestor
title author year price 是book bookstore的后代节点Descendant
XPath语法
re库 正则表达式
# '\d+'匹配数字字符
# '\s+'匹配空白字符
# '\S+'匹配非空白字符
# '\w+'匹配单词字符[A-Za-z0-9]
# '\W+'匹配非单词字符[A-Za-z0-9]
# '^one'匹配字符串开头
# 'our4$'匹配字符串结尾
网友评论