Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions mysql/mysql建立用户.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<?php
/**
* MYSQL中新建用户流程,及一些其他对用户操作
*
* @author sulong
* @date:2015-1-6
*/

//1.用管理员账号登录MYSQL
mysql -u root -p

//2.创建一个新用户,用户名username,密码password
insert into mysql.user(Host,User,Password) values('localhost','username',password('password'));

//3.刷新系统权限表
flush privileges;

//4.赋予权限
//赋予全部数据库所有操作权限
grant all privileges on *.* to username@localhost identified by 'password';
//赋予abc数据库所有操作权限
grant all privileges on abc.* to username@localhost identified by 'password';
//赋予abc数据库查找更新的权限
grant select,update on abc.* to username@localhost identified by 'password';

//5.刷新系统权限表
flush privileges;
//end 新用户添加完成,权限设置完成


/*--MYSQL对用户的操作--*/
//查看当前用户和权限
USE mysql;
SELECT host,user,password FROM user;
//像我的MSQL打印出来就是这样
+----------------------+----------+-------------------------------------------+
| host | user | password |
+----------------------+----------+-------------------------------------------+
| localhost | root | |
| production.mysql.com | root | |
| 127.0.0.1 | root | |
| localhost | | |
| production.mysql.com | | |
| localhost | common | *C587C4B37DAF52B734BBDE1A3969207D6E61D329 |
| % | root | *81F5E21E35407D884A6CD4A731AEBFB6AF209E1B |
| localhost | username | *2470C0C06DEE42FD1618BB99005ADCA2EC9D1E19 |
+----------------------+----------+-------------------------------------------+

//查看用户username权限
show grants for username@'localhost';
+--------------------------------------------------------------------------------------------------------------------------+
| Grants for username@localhost |
+--------------------------------------------------------------------------------------------------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO 'username'@'localhost' IDENTIFIED BY PASSWORD '*6BB4837EB74329105EE4568DDA7DC67ED2CA2AD9' |
+--------------------------------------------------------------------------------------------------------------------------+

//用户username修改密码为newpassword
update mysql.user set password=password('newpassword') where User="username" and Host="localhost";
flush privileges;


//删除用户username同时删除权限
USE mysql;
DELETE FROM user WHERE User='username' and Host='localhost';
flush privileges;


//删除用户username同时删除权限,mysql5之前删除用户时必须先使用revoke 删除用户权限
drop user username@'localhost';



Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<html>
<head>
<meta http-equiv="content-type" content="text/xml; charset=utf-8" />
<title>My97DatePicker</title>
<script type="text/javascript" src="config.js"></script>
<script>
if(parent==window)
location.href = 'http://www.my97.net/';

var $d, $dp, $pdp = parent.$dp, $dt, $tdt, $sdt, $lastInput, $IE=$pdp.ie, $FF = $pdp.ff,$OPERA=$pdp.opera, $ny, $cMark = false;

if ($pdp.eCont) {
$dp = {};
for (var p in $pdp) {
$dp[p] = $pdp[p];
}
}
else
$dp = $pdp;
$dp.realLang = getCurr(langList, $dp.lang);
document.write("<script src='lang/" + $dp.realLang.name + ".js' charset='" + $dp.realLang.charset + "'><\/script>");
for (var i = 0; i < skinList.length; i++) {
document.write('<link rel="stylesheet" type="text/css" href="skin/' + skinList[i].name + '/datepicker.css" title="' + skinList[i].name + '" charset="' + skinList[i].charset + '" disabled="true"/>');
}
function getCurr(arr, name){
var isFound = false;
var item = arr[0];
for (var i = 0; i < arr.length; i++) {
if (arr[i].name == name) {
item = arr[i];
break;
}
}
return item;
}
</script>
<script type="text/javascript" src="calendar.js"></script>
</head>
<body leftmargin="0" topmargin="0" onload="$c.autoSize()">
</body>
</html>
<script>new My97DP();</script>

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
var langList =
[
{name:'en', charset:'UTF-8'},
{name:'zh-cn', charset:'gb2312'},
{name:'zh-tw', charset:'GBK'}
];

var skinList =
[
{name:'default', charset:'gb2312'},
{name:'whyGreen', charset:'gb2312'}
];
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
var $lang={
errAlertMsg: "Invalid date or the date out of range,redo or not?",
aWeekStr: ["wk", "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
aMonStr: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
clearStr: "Clear",
todayStr: "Today",
okStr: "OK",
updateStr: "OK",
timeStr: "Time",
quickStr: "Quick Selection",
err_1: 'MinDate Cannot be bigger than MaxDate!'
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
var $lang={
errAlertMsg: "���Ϸ������ڸ�ʽ�������ڳ����޶���Χ,��Ҫ������?",
aWeekStr: ["��","��","һ","��","��","��","��","��"],
aMonStr: ["һ��","����","����","����","����","����","����","����","����","ʮ��","ʮһ","ʮ��"],
clearStr: "���",
todayStr: "����",
okStr: "ȷ��",
updateStr: "ȷ��",
timeStr: "ʱ��",
quickStr: "����ѡ��",
err_1: '��С���ڲ��ܴ����������!'
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
var $lang={
errAlertMsg: "���Ϸ������ڸ�ʽ�������ڳ����޶�����,��Ҫ���N��?",
aWeekStr: ["��","��","һ","��","��","��","��","��"],
aMonStr: ["һ��","����","����","����","����","����","����","����","����","ʮ��","ʮһ","ʮ��"],
clearStr: "���",
todayStr: "����",
okStr: "�_��",
updateStr: "�_��",
timeStr: "�r�g",
quickStr: "�����x��",
err_1: '��С���ڲ��ܴ���������!'
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.Wdate{
border:#999 1px solid;
height:20px;
background:#fff url(datePicker.gif) no-repeat right;
}

.WdateFmtErr{
font-weight:bold;
color:red;
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading