学习笔记
实例介绍命令行下向mysql添加新用户并分配权限
进入mysql的bin目录后
命令格式如下:
- bin>mysql -u root -p
回车后输入密码
命令格式
grant 权限1,权限2,...权限n on 数据库名称.表名称 to 用户名@用户地址 identified by '连接口令';
权限:
select,insert,update,delete,create,drop,index,alter,grant,references,reload,shutdown,process,file
如果允许全部权限,可以用all或者all privileges代替以上权限。
例如:
- mysql>grant select,insert,update,delete,create,drop on data1.table1 to austin@192.168.1.1 identified by '123';
给来自192.168.1.1的用户austin分配可对数据库data1的table1表进行select,insert,update,delete,create,drop等操作的权限,并设定口令为123。
- mysql>grant all privileges on data1.* to austin@192.168.1.1 identified by '123';
给来自192.168.1.1的用户austin分配可对数据库data1所有表进行所有操作的权限,并设定口令为123。
- mysql>grant all privileges on *.* to austin@192.168.1.1 identified by '123';
给来自192.168.1.1的用户austin分配可对所有数据库的所有表进行所有操作的权限,并设定口令为123。
- mysql>grant all privileges on *.* to austin@localhost identified by '123';
给本机用户austin分配可对所有数据库的所有表进行所有操作的权限,并设定口令为123。
- mysql>grant all privileges on *.* to austin@* identified by '123';
给任意连接过来的用户austin分配可对所有数据库的所有表进行所有操作的权限,并设定口令为123。(非必要时禁用,实在是太危险了。)
相关日志
windows下apache_2.2.4配置支持php-5.2.3,非CGI模式!
首先分别从http://www.apache.org和http://www.php.net下载apache2.2.4和php5.2.3
然后APACHE正常安装。
PHP解压缩到任意位置。比如我们这里是d:/php
然后编辑apache安装目录下的子目录conf里面的httpd.conf
添加以下信息
- LoadModule php5_module "D:/php/php5apache2_2.dll"
- AddType application/x-httpd-php .php
- PHPIniDir "D:/php"
解释一下哦。
第一行,指定apache2.2.x去读取php5的那个dll文件。我本来是读取php5apache2.dll但是重新启动apache的时候一直报错,所以才想起来php目录下面还有一个php5apache2_2.dll
第二行,就是大家都熟悉的给apache添加一个文件类型的解析
第三行,以前的版本没有看到的哦。这个是指定php.ini的位置。以后就不用拷贝php.ini到WINDOWS目录下了。
顺便,PHP.ini在配置支持模块的时候有个地方要注意
就是extension_dir = 这个位置
默认是
- extension_dir = "./"
很多时候,采用默认的这个方法都是无法正常获得ext目录的所在的。所以这里我们修改为:
- extension_dir = "D:/php/ext"
这样。就不会找不到ext的目录而产生错误了。
相关日志
网页制作-使用标准代码-在Firefox中播放背景音乐
要让你的网页能够在Firefox浏览器中播放背景音乐,使用object标签。以下是一段标准的、跨浏览器的代码示例:(当年搜索来自mozilla社区)
- <object data="music.mp3" type="application/x-mplayer2" width="0" height="0">
- <param name="src" value="music.mp3">
- <param name="autostart" value="1">
- <param name="playcount" value="infinite">
- </object>






